summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-04-28 09:59:47 +0200
committerGitHub <noreply@github.com>2021-04-28 09:59:47 +0200
commit7bca90769cbf7ae29023ca8d83ba7ab3137deda3 (patch)
tree391d3449d6ef50709e44b21b60de054a533a2921
parent5c5cfaabf251151e0f62edcff5e8d1e71f521f42 (diff)
parentde5387ab820711ab34a8a2f3d8a047d3129d2a64 (diff)
Merge pull request #47595 from EricEzaM/PR/fix-lineedit-ctrl-backspace
Fixed issues with LineEdit Delete Word & Backspace Word.
-rw-r--r--scene/gui/line_edit.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 124a07fa65..1aff5d5390 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -155,6 +155,7 @@ void LineEdit::_backspace(bool p_word, bool p_all_to_left) {
for (int i = words.size() - 1; i >= 0; i--) {
if (words[i].x < cc) {
cc = words[i].x;
+ break;
}
}
@@ -202,6 +203,7 @@ void LineEdit::_delete(bool p_word, bool p_all_to_right) {
}
delete_text(caret_column, cc);
+ set_caret_column(caret_column);
} else {
if (caret_mid_grapheme_enabled) {
set_caret_column(caret_column + 1);