Skip to content

Commit

Permalink
Fix LineEdit behavior for deleting all the way to the left/right
Browse files Browse the repository at this point in the history
  • Loading branch information
passivestar committed Feb 7, 2024
1 parent 36e943b commit 2c0d0c1
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 2c0d0c1

Please sign in to comment.