Browse Source

Fix backspace when selection reaches left edge

Fixes #60866.
Paweł Fertyk 3 years ago
parent
commit
d1aed90976
2 changed files with 171 additions and 150 deletions
  1. 1 1
      scene/gui/text_edit.cpp
  2. 170 149
      tests/scene/test_text_edit.h

+ 1 - 1
scene/gui/text_edit.cpp

@@ -2388,7 +2388,7 @@ void TextEdit::_move_caret_page_down(bool p_select) {
 }
 }
 
 
 void TextEdit::_do_backspace(bool p_word, bool p_all_to_left) {
 void TextEdit::_do_backspace(bool p_word, bool p_all_to_left) {
-	if (!editable || (caret.column == 0 && caret.line == 0)) {
+	if (!editable || (caret.column == 0 && caret.line == 0 && !has_selection())) {
 		return;
 		return;
 	}
 	}
 
 

File diff suppressed because it is too large
+ 170 - 149
tests/scene/test_text_edit.h


Some files were not shown because too many files changed in this diff