aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/run.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2020-07-12 22:57:53 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2020-07-12 22:57:53 -0400
commit0a6193a76de6aca1f17996404cc641b5a365af6f (patch)
tree91af549127359ff547f1c2f993e80ed5fa0bef5b /modules/textadept/run.lua
parentebd67cde9828e74339c913a62150eb93ba97fe14 (diff)
downloadtextadept-0a6193a76de6aca1f17996404cc641b5a365af6f.tar.gz
textadept-0a6193a76de6aca1f17996404cc641b5a365af6f.zip
Made `ui.find.goto_file_found()` and `textadept.run.goto_error()` args optional.
Diffstat (limited to 'modules/textadept/run.lua')
-rw-r--r--modules/textadept/run.lua6
1 files changed, 4 insertions, 2 deletions
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