summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorrequizm <mehmet41650@gmail.com>2021-08-17 02:30:14 +0300
committerrequizm <mehmet41650@gmail.com>2021-08-17 02:30:14 +0300
commit37ad82a7f72c1b9c671c7143e6eae4f8f9e6d5a4 (patch)
tree6e3a5f6e9a62ef2a5ebbbbdbb5b70964a0ca7da2 /scene/gui
parent7013199fb1f9990f8a3173d9557ccb38b1dbcadf (diff)
We can delete all text on TextEdit
While all text of TextEdit was selected, deletion with backspace did not occur. It can now be deleted.
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/text_edit.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index a2c5769947..12f0c9e89a 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -4906,6 +4906,11 @@ void TextEdit::_backspace() {
return;
}
+ if (has_selection()) {
+ delete_selection();
+ return;
+ }
+
int cc = get_caret_column();
int cl = get_caret_line();
@@ -4913,11 +4918,6 @@ void TextEdit::_backspace() {
return;
}
- if (has_selection()) {
- delete_selection();
- return;
- }
-
int prev_line = cc ? cl : cl - 1;
int prev_column = cc ? (cc - 1) : (text[cl - 1].length());