Merge pull request #52662 from Chaosus/fix_bookmarks
Fix editor crash on pressing `Go to Previous Bookmark` menu button
This commit is contained in:
commit
ce8dbef6a0
@ -1755,7 +1755,7 @@ void CodeTextEditor::goto_prev_bookmark() {
|
|||||||
text_editor->set_caret_line(bmarks[bmarks.size() - 1]);
|
text_editor->set_caret_line(bmarks[bmarks.size() - 1]);
|
||||||
text_editor->center_viewport_to_caret();
|
text_editor->center_viewport_to_caret();
|
||||||
} else {
|
} else {
|
||||||
for (int i = bmarks.size(); i >= 0; i--) {
|
for (int i = bmarks.size() - 1; i >= 0; i--) {
|
||||||
int bmark_line = bmarks[i];
|
int bmark_line = bmarks[i];
|
||||||
if (bmark_line < line) {
|
if (bmark_line < line) {
|
||||||
text_editor->unfold_line(bmark_line);
|
text_editor->unfold_line(bmark_line);
|
||||||
|
@ -1242,7 +1242,7 @@ void ScriptTextEditor::_edit_option(int p_op) {
|
|||||||
tx->set_caret_line(bpoints[bpoints.size() - 1]);
|
tx->set_caret_line(bpoints[bpoints.size() - 1]);
|
||||||
tx->center_viewport_to_caret();
|
tx->center_viewport_to_caret();
|
||||||
} else {
|
} else {
|
||||||
for (int i = bpoints.size(); i >= 0; i--) {
|
for (int i = bpoints.size() - 1; i >= 0; i--) {
|
||||||
int bline = bpoints[i];
|
int bline = bpoints[i];
|
||||||
if (bline < line) {
|
if (bline < line) {
|
||||||
tx->unfold_line(bline);
|
tx->unfold_line(bline);
|
||||||
|
Loading…
Reference in New Issue
Block a user