diff options
author | 2014-11-26 20:34:23 -0500 | |
---|---|---|
committer | 2014-11-26 20:34:23 -0500 | |
commit | a5b9b2d90cba4170353f2dcfcf15826e673c377c (patch) | |
tree | 9bdd55abaa8e5ad3d07cb86a51993fbbd5755466 | |
parent | b21e66a3cd20e088149926ecdf5710dabd1ec03b (diff) | |
download | textadept-a5b9b2d90cba4170353f2dcfcf15826e673c377c.tar.gz textadept-a5b9b2d90cba4170353f2dcfcf15826e673c377c.zip |
Fixed bug in jumping to compile/run errors and clear annotations before builds.
-rw-r--r-- | core/ui.lua | 4 | ||||
-rw-r--r-- | modules/textadept/run.lua | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/core/ui.lua b/core/ui.lua index f90c5626..f8607392 100644 --- a/core/ui.lua +++ b/core/ui.lua @@ -183,7 +183,7 @@ end function ui.goto_file(filename, split, preferred_view, sloppy) local patt = '^'..filename..'$' if sloppy then - local i = filename:reverse():find('[/\\]%.%.?') -- ./ or ../ + 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 @@ -438,7 +438,7 @@ if CURSES then events.connect(events.MOUSE, function(event, button, y, x) if event == buffer.MOUSE_RELEASE or button ~= 1 then return end if event == buffer.MOUSE_PRESS then - local view = get_view(ui.get_split_table(), y - 1, x) -- title is at y=1 + local view = get_view(ui.get_split_table(), y - 1, x) -- title is at y = 1 if not view[1] and not view[2] then ui.goto_view(_VIEWS[view]) resize = nil diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua index 2baa470c..6ccc094f 100644 --- a/modules/textadept/run.lua +++ b/modules/textadept/run.lua @@ -66,9 +66,10 @@ local function command(commands, event) io.save_file() command = commands[buffer.filename:match('[^.]+$')] or commands[buffer:get_lexer()] - cwd = buffer.filename:match('^(.+[/\\])[^/\\]+$') or '' + cwd = buffer.filename:match('^(.+)[/\\][^/\\]+$') or '' data = buffer:get_lexer() else + for i = 1, #_BUFFERS do _BUFFERS[i]:annotation_clear_all() end cwd = io.get_project_root() command = commands[cwd] if not command then @@ -299,7 +300,7 @@ function M.goto_error(line, next) local error = get_error(buffer:get_line(line):match('^[^\r\n]*')) if not error then if CURSES then view:goto_buffer(cur_buf) end return end textadept.editing.select_line() - ui.goto_file(M.cwd..error.filename, true, preferred_view, true) + ui.goto_file(M.cwd..'/'..error.filename, true, preferred_view, true) local line, message = error.line, error.message buffer:goto_line(line - 1) if message then |