Fix breakpoints resetting on external editor save
This commit is contained in:
@@ -1503,21 +1503,27 @@ void CodeTextEditor::set_edit_state(const Variant &p_state) {
|
||||
if (state.has("folded_lines")) {
|
||||
const PackedInt32Array folded_lines = state["folded_lines"];
|
||||
for (const int &line : folded_lines) {
|
||||
text_editor->fold_line(line);
|
||||
if (line < text_editor->get_line_count()) {
|
||||
text_editor->fold_line(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (state.has("breakpoints")) {
|
||||
const PackedInt32Array breakpoints = state["breakpoints"];
|
||||
for (const int &line : breakpoints) {
|
||||
text_editor->set_line_as_breakpoint(line, true);
|
||||
if (line < text_editor->get_line_count()) {
|
||||
text_editor->set_line_as_breakpoint(line, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (state.has("bookmarks")) {
|
||||
const PackedInt32Array bookmarks = state["bookmarks"];
|
||||
for (const int &line : bookmarks) {
|
||||
text_editor->set_line_as_bookmarked(line, true);
|
||||
if (line < text_editor->get_line_count()) {
|
||||
text_editor->set_line_as_bookmarked(line, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user