summaryrefslogtreecommitdiffstats
path: root/editor/plugins/script_text_editor.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-12-22 12:34:03 +0100
committerGitHub <noreply@github.com>2019-12-22 12:34:03 +0100
commitf7d8dd79e969c684c44e3737fd26fd90c523ca07 (patch)
tree1a22b0d62eb2cc57eb76cd1d5ea143018d2d977c /editor/plugins/script_text_editor.cpp
parente4ecfe90f92a67304e5a2b27af94e6be224eb6c6 (diff)
parentb8bbf5a55f29e2dc20bb961901bebabf64183bee (diff)
downloadredot-engine-f7d8dd79e969c684c44e3737fd26fd90c523ca07.tar.gz
Merge pull request #34441 from KoBeWi/wrapping_things_up
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.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index ec1cda5287..c57ffa8ee3 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -1309,6 +1309,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();
@@ -1335,6 +1336,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();