aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+667e-11@users.noreply.github.com>2020-03-12 14:00:02 -0400
committerGravatar mitchell <70453897+667e-11@users.noreply.github.com>2020-03-12 14:00:02 -0400
commitea36799f3776c1840dc6635c47d0ba6e87f1664a (patch)
tree2f7bcac00ce8a82b1de55cf50e2384d84165ca69 /modules
parent19e5d127b75246e1a80e1914c7b1ab45d0b0bbfe (diff)
Fixed regression recently introduced in brace highlighting.
`buffer:brace_bad_light()` was not being given the correct parameters.
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