From de5387ab820711ab34a8a2f3d8a047d3129d2a64 Mon Sep 17 00:00:00 2001 From: EricEzaM Date: Sat, 3 Apr 2021 21:23:18 +1000 Subject: [PATCH] Fixed issues with LineEdit Delete Word & Backspace Word. Backspace word was deleting all text before the cursor, and delete word was no updating until another action was performed on the LineEdit (in order to update it) --- scene/gui/line_edit.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 124a07fa652..1aff5d5390c 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);