mirror of
https://github.com/godotengine/godot.git
synced 2025-04-07 00:44:24 +08:00
now undo/redo supported
This commit is contained in:
parent
05801b9265
commit
380f12def2
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user