summaryrefslogtreecommitdiffstats
path: root/scene/gui/code_edit.cpp
diff options
context:
space:
mode:
authorJean-Michel Bernard <jmb462@gmail.com>2021-10-01 20:22:22 +0200
committerJean-Michel Bernard <jmb462@gmail.com>2021-10-01 20:23:52 +0200
commit9c375170e4dca5e62615fe5852414587e09c9434 (patch)
tree03fb7425e134cb9b26077f6f6b5e55ba00a2195a /scene/gui/code_edit.cpp
parent871910feaff2c692695a4c01115fc4c653ed41c9 (diff)
downloadredot-engine-9c375170e4dca5e62615fe5852414587e09c9434.tar.gz
Fix deleting selection at the first line do not work with backspace
Diffstat (limited to 'scene/gui/code_edit.cpp')
-rw-r--r--scene/gui/code_edit.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp
index 28d1689ff8..b816f12bc3 100644
--- a/scene/gui/code_edit.cpp
+++ b/scene/gui/code_edit.cpp
@@ -614,6 +614,11 @@ void CodeEdit::_backspace_internal() {
return;
}
+ if (has_selection()) {
+ delete_selection();
+ return;
+ }
+
int cc = get_caret_column();
int cl = get_caret_line();
@@ -621,11 +626,6 @@ void CodeEdit::_backspace_internal() {
return;
}
- if (has_selection()) {
- delete_selection();
- return;
- }
-
if (cl > 0 && _is_line_hidden(cl - 1)) {
unfold_line(get_caret_line() - 1);
}