summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorDana Olson <dana@shineuponthee.com>2014-12-07 02:21:49 -0500
committerDana Olson <dana@shineuponthee.com>2014-12-07 02:21:49 -0500
commit380f12def25e4031756354907e8d5abe5466b864 (patch)
treee92454bcc3e3c7a43a4929f50e5de09a1ee5f694 /scene
parent05801b92652f3fc21063a8aab516633769c9ba55 (diff)
now undo/redo supported
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/text_edit.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 3f0dc22ab6..f1100c7c20 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -3150,18 +3150,15 @@ void TextEdit::set_line(int line, String new_text)
{
if (line < 0 || line > text.size())
return;
- text.remove(line); // TODO: Make this Undo/Redoable....
- insert_at(new_text, line);
- //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)
{
- 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);
+ cursor_set_column(0);
+ cursor_set_line(at);
+ _insert_text(at, 0, p_text+"\n");
}
void TextEdit::set_show_line_numbers(bool p_show) {