diff options
Diffstat (limited to '')
| -rw-r--r-- | scene/gui/text_edit.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index b95d27139..f1100c7c2 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -3150,12 +3150,15 @@ void TextEdit::set_line(int line, String new_text) { if (line < 0 || line > text.size()) return; - text.set(line, new_text); + _remove_text(line, 0, line, text[line].length()); + _insert_text(line, 0, new_text); } void TextEdit::insert_at(const String &p_text, int at) { - text.insert(at, p_text); + cursor_set_column(0); + cursor_set_line(at); + _insert_text(at, 0, p_text+"\n"); } void TextEdit::set_show_line_numbers(bool p_show) { |
