diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-06-22 23:54:04 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-06-22 23:54:04 -0300 |
commit | 6154cff93fb16e94479ce93da6a94a525640aa50 (patch) | |
tree | 3fa1954e1f6b193d569d66cfaa4defbe36974738 /tools/editor/plugins | |
parent | 8f9f03e37495d4c5ca44ef7d72e972e3e33ade5a (diff) | |
parent | 14cd70faf3b9e431821613b06397973f047cbfc0 (diff) |
Merge pull request #2101 from sanikoyes/Pr-script-editor-save-state
Pr-Script editor
Diffstat (limited to 'tools/editor/plugins')
-rw-r--r-- | tools/editor/plugins/script_editor_plugin.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index cf934b988d..71ce040b05 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -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(); } |