From a5f07d18ec066e85d442e2cab200b9eadbe2981d Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Tue, 5 Apr 2016 13:52:18 +0100 Subject: [PATCH] Fixed undoing twice when removing selection (cherry picked from commit 15f43149e179f754f48b59ac08002d5c4c0a5bc0) --- scene/gui/text_edit.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 6f17ce03602..6a06888243d 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -1747,6 +1747,7 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { } if (clear) { + _begin_compex_operation(); selection.active=false; update(); _remove_text(selection.from_line,selection.from_column,selection.to_line,selection.to_column); @@ -2396,6 +2397,10 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { if (insert_mode && !had_selection) { _end_compex_operation(); } + + if (selection.active != had_selection) { + _end_compex_operation(); + } accept_event(); } else {