From c46527cc32aef6fd332ea5e45757c0858b1cbb5d Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Mon, 30 Mar 2020 18:44:15 -0400 Subject: Fixed off-by-one issues with `buffer:get_cur_line()`. --- doc/manual.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/manual.md') diff --git a/doc/manual.md b/doc/manual.md index 2779713d..880e3313 100644 --- a/doc/manual.md +++ b/doc/manual.md @@ -2080,6 +2080,10 @@ In migrating Textadept's internals, the following changes were made: * Marker or indicator masks are produced by subtracting 1 from marker or indicator numbers. For example, `1 << textadept.bookmarks.MARK_BOOKMARK` changes to `1 << textadept.bookmarks.MARK_BOOKMARK - 1`. +* Logic that depends on the return value of `buffer:get_cur_line()` may need to + be changed. For example, any subsequent references to `pos` after + `local line, pos = buffer:get_cur_line()` like `if line:sub(1, pos) ... end` + need to be changed to `if line:sub(1, pos - 1) ... end`. I found it helpful to quickly scan source files for syntax-highlighted numbers and then seeing if those numbers needed to be changed. Searching for "- 1", -- cgit v1.2.3