From 91ee21cf2cc25547908635af788e7955bfae030b Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 28 Mar 2013 21:36:58 -0400 Subject: 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. --- core/gui.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'core/gui.lua') 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 -- cgit v1.2.3