aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc/manual.md2
-rw-r--r--modules/textadept/bookmarks.lua4
-rw-r--r--modules/textadept/editing.lua5
-rw-r--r--modules/textadept/find.lua2
-rw-r--r--modules/textadept/run.lua4
5 files changed, 10 insertions, 7 deletions
diff --git a/doc/manual.md b/doc/manual.md
index 21ef0510..16ba4854 100644
--- a/doc/manual.md
+++ b/doc/manual.md
@@ -1987,6 +1987,7 @@ STRIP\_TRAILING\_SPACES |Renamed |[strip\_trailing\_spaces][]
AUTOCOMPLETE\_ALL |Renamed |[autocomplete\_all\_words][]
char\_matches |Replaced|[auto\_pairs][]
braces |Renamed |[brace\_matches][]
+[goto\_line][](line) |Changed |_line argument is 0-based_
**textadept.run** | |
RUN\_IN\_BACKGROUND |Renamed |[run\_in\_background][]
CHECK\_SYNTAX |Removed |
@@ -2021,6 +2022,7 @@ MAX\_RECENT\_FILES |Renamed |[max\_recent\_files][]
[strip\_trailing\_spaces]: api.html#textadept.editing.strip_trailing_spaces
[autocomplete\_all\_words]: api.html#textadept.editing.autocomplete_all_words
[brace\_matches]: api.html#textadept.editing.brace_matches
+[goto\_line]: api.html#textadept.editing.goto_line
[run\_in\_background]: api.html#textadept.run.run_in_background
[compile]: api.html#textadept.run.compile
[run]: api.html#textadept.run.run
diff --git a/modules/textadept/bookmarks.lua b/modules/textadept/bookmarks.lua
index 24eea717..9f2d1c10 100644
--- a/modules/textadept/bookmarks.lua
+++ b/modules/textadept/bookmarks.lua
@@ -74,7 +74,7 @@ function M.goto_mark(next)
}
if button ~= 1 or not mark then return end
view:goto_buffer(buffers[mark])
- textadept.editing.goto_line(utf8_list[mark]:match('^[^:]+:(%d+):'))
+ textadept.editing.goto_line(utf8_list[mark]:match('^[^:]+:(%d+):') - 1)
else
local f = next and buffer.marker_next or buffer.marker_previous
local current_line = buffer:line_from_position(buffer.current_pos)
@@ -82,7 +82,7 @@ function M.goto_mark(next)
if line == -1 then
line = f(buffer, (next and 0 or buffer.line_count), 2^M.MARK_BOOKMARK)
end
- if line >= 0 then textadept.editing.goto_line(line + 1) end
+ if line >= 0 then textadept.editing.goto_line(line) end
end
end
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index dddbf98a..f3c7223a 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -305,9 +305,10 @@ function M.goto_line(line)
}
line = tonumber(value)
if button ~= 1 or not line then return end
+ line = line - 1
end
- buffer:ensure_visible_enforce_policy(line - 1)
- buffer:goto_line(line - 1)
+ buffer:ensure_visible_enforce_policy(line)
+ buffer:goto_line(line)
end
---
diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua
index 366e4774..cc73964e 100644
--- a/modules/textadept/find.lua
+++ b/modules/textadept/find.lua
@@ -437,7 +437,7 @@ function M.goto_file_found(line, next)
if not utf8_filename then return end
textadept.editing.select_line()
ui.goto_file(utf8_filename:iconv(_CHARSET, 'UTF-8'), true, preferred_view)
- textadept.editing.goto_line(line_num)
+ textadept.editing.goto_line(line_num - 1)
end
events.connect(events.KEYPRESS, function(code)
if keys.KEYSYMS[code] == '\n' and is_ff_buf(buffer) then
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua
index f663eb0f..f7119a23 100644
--- a/modules/textadept/run.lua
+++ b/modules/textadept/run.lua
@@ -372,7 +372,7 @@ function M.goto_error(line, next)
line = (next and math.min or math.max)(wline, eline)
if line == -1 then return end
end
- textadept.editing.goto_line(line + 1) -- ensure visible
+ textadept.editing.goto_line(line) -- ensure visible
-- Goto the warning or error and show an annotation.
local line = buffer:get_line(line):match('^[^\r\n]*')
@@ -381,7 +381,7 @@ function M.goto_error(line, next)
textadept.editing.select_line()
ui.goto_file(cwd..(not WIN32 and '/' or '\\')..error.filename, true,
preferred_view, true)
- textadept.editing.goto_line(error.line)
+ textadept.editing.goto_line(error.line - 1)
if error.column then
buffer:goto_pos(buffer:find_column(error.line - 1, error.column - 1))
end