You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Merge pull request #110946 from KoBeWi/regions_of_ruin
Fix region folding not loading properly
This commit is contained in:
@@ -184,6 +184,11 @@ void ScriptTextEditor::enable_editor(Control *p_shortcut_context) {
|
||||
|
||||
_validate_script();
|
||||
|
||||
if (pending_state != Variant()) {
|
||||
code_editor->set_edit_state(pending_state);
|
||||
pending_state = Variant();
|
||||
}
|
||||
|
||||
if (p_shortcut_context) {
|
||||
for (int i = 0; i < edit_hb->get_child_count(); ++i) {
|
||||
Control *c = cast_to<Control>(edit_hb->get_child(i));
|
||||
@@ -704,11 +709,19 @@ bool ScriptTextEditor::is_unsaved() {
|
||||
}
|
||||
|
||||
Variant ScriptTextEditor::get_edit_state() {
|
||||
if (pending_state != Variant()) {
|
||||
return pending_state;
|
||||
}
|
||||
return code_editor->get_edit_state();
|
||||
}
|
||||
|
||||
void ScriptTextEditor::set_edit_state(const Variant &p_state) {
|
||||
code_editor->set_edit_state(p_state);
|
||||
if (editor_enabled) {
|
||||
code_editor->set_edit_state(p_state);
|
||||
} else {
|
||||
// The editor is not fully initialized, so the state can't be loaded properly.
|
||||
pending_state = p_state;
|
||||
}
|
||||
|
||||
Dictionary state = p_state;
|
||||
if (state.has("syntax_highlighter")) {
|
||||
|
||||
@@ -62,6 +62,7 @@ class ScriptTextEditor : public ScriptEditorBase {
|
||||
RichTextLabel *errors_panel = nullptr;
|
||||
|
||||
Ref<Script> script;
|
||||
Variant pending_state;
|
||||
bool script_is_valid = false;
|
||||
bool editor_enabled = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user