aboutsummaryrefslogtreecommitdiff
path: root/core/ui.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2014-11-27 11:27:57 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2014-11-27 11:27:57 -0500
commit60a6d68b8806768740fc5c19f82add73f5750cd3 (patch)
tree65fc3824337c61fc3b7d490a7b086fcbe768c61e /core/ui.lua
parentd6d9f9f906230285782c264a904de4baa60c5d3f (diff)
downloadtextadept-60a6d68b8806768740fc5c19f82add73f5750cd3.tar.gz
textadept-60a6d68b8806768740fc5c19f82add73f5750cd3.zip
Small code cleanup.
Diffstat (limited to 'core/ui.lua')
-rw-r--r--core/ui.lua5
1 files changed, 1 insertions, 4 deletions
diff --git a/core/ui.lua b/core/ui.lua
index f8607392..4574fca0 100644
--- a/core/ui.lua
+++ b/core/ui.lua
@@ -182,10 +182,7 @@ end
-- @name goto_file
function ui.goto_file(filename, split, preferred_view, sloppy)
local patt = '^'..filename..'$'
- if sloppy then
- local i = filename:reverse():find('[/\\]%.?%.?') -- ./ or ../
- patt = i and filename:sub(-i + 1, -1)..'$' or filename..'$'
- end
+ if sloppy then patt = filename:match('[^/\\]+$')..'$' end
if #_VIEWS == 1 and split and not (view.buffer.filename or ''):find(patt) then
view:split()
else