aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2013-03-28 21:36:58 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2013-03-28 21:36:58 -0400
commit91ee21cf2cc25547908635af788e7955bfae030b (patch)
tree139426aefc5d8a0b56558908668313f796f663b2 /modules/textadept
parent2fb60bd197071eb6c1da78e65e00aaaa374bdce1 (diff)
downloadtextadept-91ee21cf2cc25547908635af788e7955bfae030b.tar.gz
textadept-91ee21cf2cc25547908635af788e7955bfae030b.zip
Improved message double-clicking behavior for compile and run commands.
Added `_M.textadept.run.cwd` field for storing the working directory for more accurate relative file paths.
Diffstat (limited to 'modules/textadept')
-rw-r--r--modules/textadept/run.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua
index fd0bffbe..38eb6301 100644
--- a/modules/textadept/run.lua
+++ b/modules/textadept/run.lua
@@ -10,6 +10,9 @@ local M = {}
-- extension.
--
-- [language-specific modules]: _M.html#Compile.and.Run
+-- @field cwd (string, Read-only)
+-- The working directory for the most recently executed compile or run
+-- command.
-- @field _G.events.COMPILE_OUTPUT (string)
-- Called after executing a language's compile command.
-- By default, compiler output is printed to the message buffer. To override
@@ -70,6 +73,7 @@ local function command(cmd_table, compiling)
end
local ok, status, code = p:close()
if ok and code then events_emit(event, lexer, status..': '..code) end
+ M.cwd = filedir
lfs.chdir(current_dir)
end
@@ -203,7 +207,7 @@ function goto_error(pos, line_num)
end
local error_details = get_error_details(buffer:get_line(line_num))
if not error_details then return end
- gui.goto_file(error_details.filename, true, preferred_view, true)
+ gui.goto_file(M.cwd..error_details.filename, true, preferred_view, true)
local line, message = error_details.line, error_details.message
buffer:goto_line(line - 1)
if message then