diff options
author | 2014-06-04 22:12:45 -0400 | |
---|---|---|
committer | 2014-06-04 22:12:45 -0400 | |
commit | cf5190cebe13d9ccb579455c7fcd8f205da3d6bb (patch) | |
tree | b59cb2ae073238a66969a7ac14e9fe0a59af2e62 /modules/textadept/run.lua | |
parent | 4586dbadae4d0f5347491a6c1b02d7ea5bb077a1 (diff) | |
download | textadept-cf5190cebe13d9ccb579455c7fcd8f205da3d6bb.tar.gz textadept-cf5190cebe13d9ccb579455c7fcd8f205da3d6bb.zip |
Pressing "Enter" in message buffer simulates double-click.
In a "Find in Files" buffer, goes to the file on the current line.
In a message buffer, jumps to the error or warning on the current line.
Diffstat (limited to 'modules/textadept/run.lua')
-rw-r--r-- | modules/textadept/run.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua index 77748fdb..f07ead03 100644 --- a/modules/textadept/run.lua +++ b/modules/textadept/run.lua @@ -298,7 +298,7 @@ function M.goto_error(line, next) buffer:goto_line(line) -- Goto the warning or error and show an annotation. - local error = get_error(buffer:get_line(line):match('^[^\r\n]+')) + local error = get_error(buffer:get_line(line):match('^[^\r\n]*')) if not error then if CURSES then view:goto_buffer(cur_buf) end return end textadept.editing.select_line() ui.goto_file(M.cwd..error.filename, true, preferred_view, true) @@ -309,6 +309,13 @@ function M.goto_error(line, next) if not error.warning then buffer.annotation_style[line - 1] = 8 end -- error end end +events.connect(events.KEYPRESS, function(code) + if keys.KEYSYMS[code] == '\n' and is_msg_buf(buffer) and M.cwd and + get_error(buffer:get_cur_line():match('^[^\r\n]*')) then + M.goto_error(buffer:line_from_position(buffer.current_pos)) + return true + end +end) events.connect(events.DOUBLE_CLICK, function(pos, line) if is_msg_buf(buffer) and M.cwd then M.goto_error(line) end end) |