aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2019-09-19 11:53:02 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2019-09-19 11:53:02 -0400
commitc75e5899db73f3a1f05c43b3bfd8a6ec80ff8a89 (patch)
tree12aab7a73e8db1f7d069f91deab32bfde3d0fd12
parente19d831cf673411bb8a1c96a27131cf9cde496a0 (diff)
downloadtextadept-c75e5899db73f3a1f05c43b3bfd8a6ec80ff8a89.tar.gz
textadept-c75e5899db73f3a1f05c43b3bfd8a6ec80ff8a89.zip
Properly handle absolute paths in run output and case-insensitivity on Windows.
-rw-r--r--core/ui.lua5
-rw-r--r--modules/textadept/run.lua6
2 files changed, 9 insertions, 2 deletions
diff --git a/core/ui.lua b/core/ui.lua
index 9f940e32..0d1c72bb 100644
--- a/core/ui.lua
+++ b/core/ui.lua
@@ -243,6 +243,11 @@ end
-- @name goto_file
function ui.goto_file(filename, split, preferred_view, sloppy)
local patt = '^'..filename..'$' -- TODO: escape filename properly
+ if WIN32 then
+ filename = filename:gsub('%a', function(letter)
+ return string.format('[%s%s]', letter:upper(), letter:lower())
+ end)
+ end
if sloppy then patt = filename:match('[^/\\]+$')..'$' end
if #_VIEWS == 1 and split and not (view.buffer.filename or ''):find(patt) then
view:split()
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua
index 4c92c433..a150ba77 100644
--- a/modules/textadept/run.lua
+++ b/modules/textadept/run.lua
@@ -379,8 +379,10 @@ function M.goto_error(line, next)
local error = scan_for_error(line:iconv(_CHARSET, 'UTF-8'))
if not error then return end
textadept.editing.select_line()
- ui.goto_file(cwd..(not WIN32 and '/' or '\\')..error.filename, true,
- preferred_view, true)
+ if not error.filename:find(not WIN32 and '^/' or '^%a:[/\\]') then
+ error.filename = cwd..(not WIN32 and '/' or '\\')..error.filename
+ end
+ ui.goto_file(error.filename, true, preferred_view, true)
textadept.editing.goto_line(error.line - 1)
if error.column then
buffer:goto_pos(buffer:find_column(error.line - 1, error.column - 1))