Fix editing after undo not clearing the change id (#1574)

This commit is contained in:
Guldoman 2023-11-29 16:45:53 +01:00 committed by takase1121
parent 8eacca7ae1
commit b1a647814f
No known key found for this signature in database
GPG Key ID: 60EEFFC68EB3031B
1 changed files with 4 additions and 0 deletions

View File

@ -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")