From c75338fce649857a975af47ae9ea5802c60b7148 Mon Sep 17 00:00:00 2001 From: kobewi Date: Fri, 14 Oct 2022 15:37:28 +0200 Subject: [PATCH] Preserve caret when updating EditorPropertyText --- editor/editor_properties.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 332e47dc520..899fa69be19 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -90,7 +90,9 @@ void EditorPropertyText::update_property() { String s = get_edited_object()->get(get_edited_property()); updating = true; if (text->get_text() != s) { + int caret = text->get_caret_column(); text->set_text(s); + text->set_caret_column(caret); } text->set_editable(!is_read_only()); updating = false;