Skip to content

Commit

Permalink
Merge pull request #88057 from passivestar/cmd-backspace-lineedit
Browse files Browse the repository at this point in the history
Fix LineEdit behavior for deleting all the way to the left/right
  • Loading branch information
akien-mga committed Feb 13, 2024
2 parents b50001e + 2c0d0c1 commit 768ab25
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scene/gui/line_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ void LineEdit::_backspace(bool p_word, bool p_all_to_left) {

if (p_all_to_left) {
deselect();
text = text.substr(0, caret_column);
text = text.substr(caret_column);
_shape();
set_caret_column(0);
_text_changed();
return;
}
Expand Down Expand Up @@ -176,9 +178,8 @@ void LineEdit::_delete(bool p_word, bool p_all_to_right) {

if (p_all_to_right) {
deselect();
text = text.substr(caret_column, text.length() - caret_column);
text = text.substr(0, caret_column);
_shape();
set_caret_column(0);
_text_changed();
return;
}
Expand Down

0 comments on commit 768ab25

Please sign in to comment.