diff options
author | Tomasz Chabora <kobewi4e@gmail.com> | 2019-12-18 21:58:18 +0100 |
---|---|---|
committer | Tomasz Chabora <kobewi4e@gmail.com> | 2019-12-18 21:58:47 +0100 |
commit | b8bbf5a55f29e2dc20bb961901bebabf64183bee (patch) | |
tree | 9101188b059669f30fc3c36ebe44ddbee3e0b85d /editor/plugins/script_text_editor.cpp | |
parent | 9cda7f73339f8899fa0a8d0a7ca9e9a002a202ce (diff) | |
download | redot-engine-b8bbf5a55f29e2dc20bb961901bebabf64183bee.tar.gz |
Fix code editor not always centering to bookmarks
Diffstat (limited to 'editor/plugins/script_text_editor.cpp')
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 9bda0f50e4..b6eaeb4280 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1303,6 +1303,7 @@ void ScriptTextEditor::_edit_option(int p_op) { if (line >= bpoints[bpoints.size() - 1]) { tx->unfold_line(bpoints[0]); tx->cursor_set_line(bpoints[0]); + tx->center_viewport_to_cursor(); } else { for (List<int>::Element *E = bpoints.front(); E; E = E->next()) { int bline = E->get(); @@ -1329,6 +1330,7 @@ void ScriptTextEditor::_edit_option(int p_op) { if (line <= bpoints[0]) { tx->unfold_line(bpoints[bpoints.size() - 1]); tx->cursor_set_line(bpoints[bpoints.size() - 1]); + tx->center_viewport_to_cursor(); } else { for (List<int>::Element *E = bpoints.back(); E; E = E->prev()) { int bline = E->get(); |