aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/textadept/editing.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index 15074bae..9d2f5e7b 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -158,10 +158,13 @@ end, 1) -- need index of 1 because default key handler halts propagation
events.connect(events.UPDATE_UI, function(updated)
if updated and updated & 3 == 0 then return end -- ignore scrolling
local pos = buffer.selection_n_caret[buffer.main_selection]
- local match =
- M.brace_matches[buffer.char_at[pos]] and buffer:brace_match(pos, 0) or -1
- local f = match ~= -1 and buffer.brace_highlight or buffer.brace_bad_light
- f(buffer, pos, match)
+ if M.brace_matches[buffer.char_at[pos]] then
+ local match = buffer:brace_match(pos, 0)
+ local f = match ~= -1 and buffer.brace_highlight or buffer.brace_bad_light
+ f(buffer, pos, match)
+ return
+ end
+ buffer:brace_bad_light(-1)
end)
-- Moves over typeover characters when typed, taking multiple selections into