From f457bc33fa50e9545cb11f22914a06e8ad51129b Mon Sep 17 00:00:00 2001 From: Guldoman Date: Wed, 29 Nov 2023 16:45:53 +0100 Subject: [PATCH] Fix editing after undo not clearing the change id (#1574) --- data/core/doc/init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data/core/doc/init.lua b/data/core/doc/init.lua index deeb3816..c3eeba87 100644 --- a/data/core/doc/init.lua +++ b/data/core/doc/init.lua @@ -488,6 +488,10 @@ end function Doc:insert(line, col, text) self.redo_stack = { idx = 1 } + -- Reset the clean id when we're pushing something new before it + if self:get_change_id() < self.clean_change_id then + self.clean_change_id = -1 + end line, col = self:sanitize_position(line, col) self:raw_insert(line, col, text, self.undo_stack, system.get_time()) self:on_text_change("insert")