summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/text_edit.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 75174a85de..681c33652e 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -3494,6 +3494,9 @@ void TextEdit::set_line(int line, String new_text)
return;
_remove_text(line, 0, line, text[line].length());
_insert_text(line, 0, new_text);
+ if (cursor.line==line) {
+ cursor.column=MIN(cursor.column,new_text.length());
+ }
}
void TextEdit::insert_at(const String &p_text, int at)