summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-09-29 23:15:06 +0200
committerGitHub <noreply@github.com>2021-09-29 23:15:06 +0200
commit92d88fde2ca5e9b077ab591165e45de103bfd827 (patch)
tree4ca115ba8861e4e07061cd09e70b9ca14bf77eb6
parent86a2e104dc7cb7532db92157f10e9cb6813c8efc (diff)
parent7926d75d0278dc08cd98e674658591149ff01026 (diff)
Merge pull request #53223 from Paulb23/fix-autocomplete-trigger
-rw-r--r--scene/gui/text_edit.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 5b13e1da0b..4ee69d336f 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -2731,7 +2731,10 @@ void TextEdit::insert_line_at(int p_at, const String &p_text) {
}
void TextEdit::insert_text_at_caret(const String &p_text) {
- begin_complex_operation();
+ bool had_selection = has_selection();
+ if (had_selection) {
+ begin_complex_operation();
+ }
delete_selection();
@@ -2743,7 +2746,9 @@ void TextEdit::insert_text_at_caret(const String &p_text) {
set_caret_column(new_column);
update();
- end_complex_operation();
+ if (had_selection) {
+ end_complex_operation();
+ }
}
void TextEdit::remove_text(int p_from_line, int p_from_column, int p_to_line, int p_to_column) {