From 3ce1997b68b0454840870e35d84a4bb5feddfab3 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+orbitalquark@users.noreply.github.com> Date: Sat, 12 Jun 2021 11:26:54 -0400 Subject: Fixed incorrect bitwise operation. This consolidates changes from r3135 and r3149 and fixes an additional restore selection case. --- core/events.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/events.lua') diff --git a/core/events.lua b/core/events.lua index 52b1dc37..f0c20fe3 100644 --- a/core/events.lua +++ b/core/events.lua @@ -415,7 +415,7 @@ end -- Emits events prior to and after replacing buffer text. M.connect(M.MODIFIED, function(position, mod, text, length) if mod & (DELETE | INSERT) == 0 or length ~= buffer.length then return end - if mod & (INSERT | UNDOREDO) > 0 then + if mod & (INSERT | UNDOREDO) == INSERT | UNDOREDO then -- Cannot emit BUFFER_AFTER_REPLACE_TEXT here because Scintilla will do things like update -- the selection afterwards, which could undo what event handlers do. events.connect(events.UPDATE_UI, emit_after_replace_text) -- cgit v1.2.3