From ea36799f3776c1840dc6635c47d0ba6e87f1664a Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 12 Mar 2020 14:00:02 -0400 Subject: Fixed regression recently introduced in brace highlighting. `buffer:brace_bad_light()` was not being given the correct parameters. --- modules/textadept/editing.lua | 11 +++++++---- 1 file 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 -- cgit v1.2.3