From 3721ace099b9360bd8e0fb36f299fe60126b4a02 Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Tue, 6 Apr 2021 08:26:53 +0200 Subject: [PATCH] Fix logical error in on_text_change --- data/core/doc/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/core/doc/init.lua b/data/core/doc/init.lua index 378f0896..3f1c39cd 100644 --- a/data/core/doc/init.lua +++ b/data/core/doc/init.lua @@ -262,11 +262,13 @@ local function pop_undo(self, undo_stack, redo_stack, modified) self.selection.b.line, self.selection.b.col = cmd[3], cmd[4] end + modified = modified or (cmd.type ~= "selection") + -- if next undo command is within the merge timeout then treat as a single -- command and continue to execute it local next = undo_stack[undo_stack.idx - 1] if next and math.abs(cmd.time - next.time) < config.undo_merge_timeout then - return pop_undo(self, undo_stack, redo_stack, modified or cmd.type ~= "selection") + return pop_undo(self, undo_stack, redo_stack, modified) end if modified then