diff options
author | 2012-03-25 12:26:29 -0400 | |
---|---|---|
committer | 2012-03-25 12:26:29 -0400 | |
commit | 50ee1f80ae539185f1d72ece6660b80997f0b2c2 (patch) | |
tree | 6dac5f0e6da220741b1f1fab3296b058b21374ee /modules/textadept/run.lua | |
parent | 1329e9cd55f2741d1d8924b416b1646c23e7dee0 (diff) | |
download | textadept-50ee1f80ae539185f1d72ece6660b80997f0b2c2.tar.gz textadept-50ee1f80ae539185f1d72ece6660b80997f0b2c2.zip |
Improved message double-clicking behavior for run and compile commands.
Diffstat (limited to 'modules/textadept/run.lua')
-rw-r--r-- | modules/textadept/run.lua | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua index b8af5f66..da914e24 100644 --- a/modules/textadept/run.lua +++ b/modules/textadept/run.lua @@ -36,6 +36,8 @@ local events, events_connect, events_emit = events, events.connect, events.emit local COMPILE_OUTPUT, RUN_OUTPUT = 'compile_output', 'run_output' events.COMPILE_OUTPUT, events.RUN_OUTPUT = COMPILE_OUTPUT, RUN_OUTPUT +local preferred_view + --- -- Executes the command line parameter and prints the output to Textadept. -- @param command The command line string. @@ -47,6 +49,7 @@ events.COMPILE_OUTPUT, events.RUN_OUTPUT = COMPILE_OUTPUT, RUN_OUTPUT -- @param lexer The current lexer. -- @name execute function M.execute(command, lexer) + preferred_view = view local filepath = buffer.filename:iconv(_CHARSET, 'UTF-8') local filedir, filename = '', filepath if filepath:find('[/\\]') then @@ -144,21 +147,16 @@ function goto_error(pos, line_num) buffer._type ~= _L['[Error Buffer]'] then return end - local buffer = buffer line = buffer:get_line(line_num) for _, error_detail in pairs(M.error_detail) do local captures = { line:match(error_detail.pattern) } if #captures > 0 then local utf8_filename = captures[error_detail.filename] local filename = utf8_filename:iconv(_CHARSET, 'UTF-8') - if lfs.attributes(filename) then - gui.goto_file(utf8_filename, true) - _M.textadept.editing.goto_line(captures[error_detail.line]) - local msg = captures[error_detail.message] - if msg then buffer:call_tip_show(buffer.current_pos, msg) end - else - error(string.format('"%s" %s', utf8_filename, _L['does not exist'])) - end + gui.goto_file(utf8_filename, true, preferred_view, true) + _M.textadept.editing.goto_line(captures[error_detail.line]) + local msg = captures[error_detail.message] + if msg then buffer:call_tip_show(buffer.current_pos, msg) end return end end |