Fixed undoing twice when removing selection

(cherry picked from commit 15f43149e1)
This commit is contained in:
Paulb23 2016-04-05 13:52:18 +01:00 committed by Rémi Verschelde
parent 71da9a1a23
commit a5f07d18ec
1 changed files with 5 additions and 0 deletions

View File

@ -1747,6 +1747,7 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
} }
if (clear) { if (clear) {
_begin_compex_operation();
selection.active=false; selection.active=false;
update(); update();
_remove_text(selection.from_line,selection.from_column,selection.to_line,selection.to_column); _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) { if (insert_mode && !had_selection) {
_end_compex_operation(); _end_compex_operation();
} }
if (selection.active != had_selection) {
_end_compex_operation();
}
accept_event(); accept_event();
} else { } else {