diff options
Diffstat (limited to 'modules/textadept')
-rw-r--r-- | modules/textadept/find.lua | 5 | ||||
-rw-r--r-- | modules/textadept/menu.lua | 12 | ||||
-rw-r--r-- | modules/textadept/run.lua | 6 |
3 files changed, 11 insertions, 12 deletions
diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua index 51abda3f..c34ce370 100644 --- a/modules/textadept/find.lua +++ b/modules/textadept/find.lua @@ -389,12 +389,13 @@ local function is_ff_buf(buf) return buf._type == _L['[Files Found Buffer]'] end -- Jumps to the source of the find in files search result on line number -- *line_num* in the buffer titled "Files Found" or, if *line_num* is `nil`, -- jumps to the next or previous search result, depending on boolean *next*. --- @param line_num The line number in the files found buffer that contains the --- search result to go to. +-- @param line_num Optional line number in the files found buffer that contains +-- the search result to go to. This parameter may be omitted completely. -- @param next Optional flag indicating whether to go to the next search result -- or the previous one. Only applicable when *line_num* is `nil`. -- @name goto_file_found function M.goto_file_found(line_num, next) + if type(line_num) == 'boolean' then line_num, next = nil, line_num end local ff_view, ff_buf = nil, nil for i = 1, #_VIEWS do if is_ff_buf(_VIEWS[i].buffer) then ff_view = _VIEWS[i] break end diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua index c61c8e81..c84e2bd7 100644 --- a/modules/textadept/menu.lua +++ b/modules/textadept/menu.lua @@ -153,11 +153,9 @@ local default_menubar = { ui.find.in_files = true ui.find.focus() end}, - {_L['Goto Next File Found'], function() - ui.find.goto_file_found(false, true) - end}, + {_L['Goto Next File Found'], function() ui.find.goto_file_found(true) end}, {_L['Goto Previous File Found'], function() - ui.find.goto_file_found(false, false) + ui.find.goto_file_found(false) end}, SEPARATOR, {_L['Jump to'], textadept.editing.goto_line} @@ -198,10 +196,8 @@ local default_menubar = { end}, {_L['Build'], textadept.run.build}, {_L['Stop'], textadept.run.stop}, - {_L['Next Error'], function() textadept.run.goto_error(false, true) end}, - {_L['Previous Error'], function() - textadept.run.goto_error(false, false) - end}, + {_L['Next Error'], function() textadept.run.goto_error(true) end}, + {_L['Previous Error'], function() textadept.run.goto_error(false) end}, SEPARATOR, { title = _L['Bookmarks'], diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua index 561d873a..13932d1a 100644 --- a/modules/textadept/run.lua +++ b/modules/textadept/run.lua @@ -355,14 +355,16 @@ local function is_msg_buf(buf) return buf._type == _L['[Message Buffer]'] end -- If *line_num* is `nil`, jumps to the next or previous warning or error, -- depending on boolean *next*. Displays an annotation with the warning or error -- message if possible. --- @param line_num The line number in the message buffer that contains the --- compile/run warning or error to go to. +-- @param line_num Optional line number in the message buffer that contains the +-- compile/run warning or error to go to. This parameter may be omitted +-- completely. -- @param next Optional flag indicating whether to go to the next recognized -- warning/error or the previous one. Only applicable when *line_num* is -- `nil`. -- @see error_patterns -- @name goto_error function M.goto_error(line_num, next) + if type(line_num) == 'boolean' then line_num, next = nil, line_num end local msg_view, msg_buf = nil, nil for i = 1, #_VIEWS do if is_msg_buf(_VIEWS[i].buffer) then msg_view = _VIEWS[i] break end |