Merge pull request #87012 from TheSofox/line-edit-undo-caret-fix

Fix `LineEdit` caret rendering/positioning on Undo.
This commit is contained in:
Rémi Verschelde 2024-01-15 13:27:02 +01:00
commit 3482da422d
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -1227,9 +1227,10 @@ void LineEdit::undo() {
TextOperation op = undo_stack_pos->get();
text = op.text;
scroll_offset = op.scroll_offset;
set_caret_column(op.caret_column);
_shape();
set_caret_column(op.caret_column);
_emit_text_change();
}
@ -1251,9 +1252,10 @@ void LineEdit::redo() {
TextOperation op = undo_stack_pos->get();
text = op.text;
scroll_offset = op.scroll_offset;
set_caret_column(op.caret_column);
_shape();
set_caret_column(op.caret_column);
_emit_text_change();
}