diff options
author | 2013-03-28 21:36:58 -0400 | |
---|---|---|
committer | 2013-03-28 21:36:58 -0400 | |
commit | 91ee21cf2cc25547908635af788e7955bfae030b (patch) | |
tree | 139426aefc5d8a0b56558908668313f796f663b2 /core/gui.lua | |
parent | 2fb60bd197071eb6c1da78e65e00aaaa374bdce1 (diff) | |
download | textadept-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 'core/gui.lua')
-rw-r--r-- | core/gui.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/gui.lua b/core/gui.lua index e6ccb9aa..f61a45b3 100644 --- a/core/gui.lua +++ b/core/gui.lua @@ -139,7 +139,11 @@ end -- `false`. -- @name goto_file function gui.goto_file(filename, split, preferred_view, sloppy) - local patt = not sloppy and '^'..filename..'$' or filename..'$' + local patt = '^'..filename..'$' + if sloppy then + local i = filename:reverse():find('[/\\]%.%.?') -- ./ or ../ + patt = i and filename:sub(-i + 1, -1)..'$' or filename..'$' + end if #_VIEWS == 1 and split and not (view.buffer.filename or ''):find(patt) then view:split() else |