now undo/redo supported
This commit is contained in:
@ -3150,18 +3150,15 @@ void TextEdit::set_line(int line, String new_text)
|
|||||||
{
|
{
|
||||||
if (line < 0 || line > text.size())
|
if (line < 0 || line > text.size())
|
||||||
return;
|
return;
|
||||||
text.remove(line); // TODO: Make this Undo/Redoable....
|
_remove_text(line, 0, line, text[line].length());
|
||||||
insert_at(new_text, line);
|
_insert_text(line, 0, new_text);
|
||||||
//text.set(line, new_text);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextEdit::insert_at(const String &p_text, int at)
|
void TextEdit::insert_at(const String &p_text, int at)
|
||||||
{
|
{
|
||||||
cursor_set_column(0);
|
cursor_set_column(0);
|
||||||
cursor_set_line(at);
|
cursor_set_line(at);
|
||||||
_insert_text(at, 0, p_text+"\n");
|
_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) {
|
void TextEdit::set_show_line_numbers(bool p_show) {
|
||||||
|
|||||||
Reference in New Issue
Block a user