From f2bb58bba27efe8af3dcdeca4403402d92030485 Mon Sep 17 00:00:00 2001 From: NyakoFox Date: Thu, 3 Oct 2024 22:12:36 -0300 Subject: [PATCH] Cancelling placing a terminal/script box shouldn't have undo events --- desktop_version/src/Editor.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/desktop_version/src/Editor.cpp b/desktop_version/src/Editor.cpp index c52db321..a7a191eb 100644 --- a/desktop_version/src/Editor.cpp +++ b/desktop_version/src/Editor.cpp @@ -2375,6 +2375,13 @@ static void commit_roomdata_tiles_change() ed.redo_buffer.clear(); } +static void uncommit() +{ + extern editorclass ed; + + ed.undo_buffer.pop_back(); +} + static void set_tile_interpolated(const int x1, const int x2, const int y1, const int y2, const int tile) { extern editorclass ed; @@ -3846,6 +3853,9 @@ void editorinput(void) if (ed.old_entity_text == "") { ed.remove_entity(ed.text_entity); + // Uncommit the past two actions + uncommit(); + uncommit(); } }