summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorDana Olson <dana@shineuponthee.com>2014-12-07 01:07:00 -0500
committerDana Olson <dana@shineuponthee.com>2014-12-07 01:07:00 -0500
commit05801b92652f3fc21063a8aab516633769c9ba55 (patch)
tree0c1457c7cb188e43efa364b6a1f5cce8ef659ab0 /scene/gui
parentc940212b8931c0cc9c24984758568c2d2d18b951 (diff)
apply patch #882 from dcubix
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/text_edit.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index b95d271394..3f0dc22ab6 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -3150,12 +3150,18 @@ void TextEdit::set_line(int line, String new_text)
{
if (line < 0 || line > text.size())
return;
- text.set(line, new_text);
+ text.remove(line); // TODO: Make this Undo/Redoable....
+ insert_at(new_text, line);
+ //text.set(line, 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");
+ //_insert_text_at_cursor(p_text);
+ //old: text.insert(at, p_text);
}
void TextEdit::set_show_line_numbers(bool p_show) {