Merge pull request #34441 from KoBeWi/wrapping_things_up
Fix code editor not always centering to bookmarks
This commit is contained in:
commit
f7d8dd79e9
@ -1573,6 +1573,7 @@ void CodeTextEditor::goto_next_bookmark() {
|
|||||||
if (line >= bmarks[bmarks.size() - 1]) {
|
if (line >= bmarks[bmarks.size() - 1]) {
|
||||||
text_editor->unfold_line(bmarks[0]);
|
text_editor->unfold_line(bmarks[0]);
|
||||||
text_editor->cursor_set_line(bmarks[0]);
|
text_editor->cursor_set_line(bmarks[0]);
|
||||||
|
text_editor->center_viewport_to_cursor();
|
||||||
} else {
|
} else {
|
||||||
for (List<int>::Element *E = bmarks.front(); E; E = E->next()) {
|
for (List<int>::Element *E = bmarks.front(); E; E = E->next()) {
|
||||||
int bline = E->get();
|
int bline = E->get();
|
||||||
@ -1598,6 +1599,7 @@ void CodeTextEditor::goto_prev_bookmark() {
|
|||||||
if (line <= bmarks[0]) {
|
if (line <= bmarks[0]) {
|
||||||
text_editor->unfold_line(bmarks[bmarks.size() - 1]);
|
text_editor->unfold_line(bmarks[bmarks.size() - 1]);
|
||||||
text_editor->cursor_set_line(bmarks[bmarks.size() - 1]);
|
text_editor->cursor_set_line(bmarks[bmarks.size() - 1]);
|
||||||
|
text_editor->center_viewport_to_cursor();
|
||||||
} else {
|
} else {
|
||||||
for (List<int>::Element *E = bmarks.back(); E; E = E->prev()) {
|
for (List<int>::Element *E = bmarks.back(); E; E = E->prev()) {
|
||||||
int bline = E->get();
|
int bline = E->get();
|
||||||
|
@ -1309,6 +1309,7 @@ void ScriptTextEditor::_edit_option(int p_op) {
|
|||||||
if (line >= bpoints[bpoints.size() - 1]) {
|
if (line >= bpoints[bpoints.size() - 1]) {
|
||||||
tx->unfold_line(bpoints[0]);
|
tx->unfold_line(bpoints[0]);
|
||||||
tx->cursor_set_line(bpoints[0]);
|
tx->cursor_set_line(bpoints[0]);
|
||||||
|
tx->center_viewport_to_cursor();
|
||||||
} else {
|
} else {
|
||||||
for (List<int>::Element *E = bpoints.front(); E; E = E->next()) {
|
for (List<int>::Element *E = bpoints.front(); E; E = E->next()) {
|
||||||
int bline = E->get();
|
int bline = E->get();
|
||||||
@ -1335,6 +1336,7 @@ void ScriptTextEditor::_edit_option(int p_op) {
|
|||||||
if (line <= bpoints[0]) {
|
if (line <= bpoints[0]) {
|
||||||
tx->unfold_line(bpoints[bpoints.size() - 1]);
|
tx->unfold_line(bpoints[bpoints.size() - 1]);
|
||||||
tx->cursor_set_line(bpoints[bpoints.size() - 1]);
|
tx->cursor_set_line(bpoints[bpoints.size() - 1]);
|
||||||
|
tx->center_viewport_to_cursor();
|
||||||
} else {
|
} else {
|
||||||
for (List<int>::Element *E = bpoints.back(); E; E = E->prev()) {
|
for (List<int>::Element *E = bpoints.back(); E; E = E->prev()) {
|
||||||
int bline = E->get();
|
int bline = E->get();
|
||||||
|
Loading…
Reference in New Issue
Block a user