mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
Merge pull request #2101 from sanikoyes/Pr-script-editor-save-state
Pr-Script editor
This commit is contained in:
commit
6154cff93f
@ -290,8 +290,19 @@ void ScriptTextEditor::reload_text() {
|
||||
|
||||
ERR_FAIL_COND(script.is_null()) ;
|
||||
|
||||
get_text_edit()->set_text(script->get_source_code());
|
||||
get_text_edit()->clear_undo_history();
|
||||
TextEdit *te = get_text_edit();
|
||||
int column = te->cursor_get_column();
|
||||
int row = te->cursor_get_line();
|
||||
int h = te->get_h_scroll();
|
||||
int v = te->get_v_scroll();
|
||||
|
||||
te->set_text(script->get_source_code());
|
||||
te->clear_undo_history();
|
||||
te->cursor_set_line(row);
|
||||
te->cursor_set_column(column);
|
||||
te->set_h_scroll(h);
|
||||
te->set_v_scroll(v);
|
||||
|
||||
_line_col_changed();
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user