diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-09-20 13:51:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-20 13:51:33 +0200 |
commit | 0a6626a5d11a170fe7a8d4a20feadbc30463e74c (patch) | |
tree | 45bf13358cb7b4afb3e348a3cec0552d5a7ecd34 /editor/plugins | |
parent | e5bdf5e37b7d0d0889dce5d0d279555599679a7b (diff) | |
parent | 4efcf9c94384fff34f9f3b629e48aa392ac6b3a0 (diff) |
Merge pull request #22268 from DualMatrix/highlight_no_save
Fixed syntax highlighting setting not being saved
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/text_editor.cpp | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index bdeeaa106d..d4ddaf274f 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -317,6 +317,7 @@ void ScriptTextEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_READY: _load_theme_settings(); + _change_syntax_highlighter(EditorSettings::get_singleton()->get_project_metadata("script_text_editor", "syntax_highlighter", 0)); break; } } @@ -1058,6 +1059,7 @@ void ScriptTextEditor::_change_syntax_highlighter(int p_idx) { } // highlighter_menu->set_item_checked(p_idx, true); set_syntax_highlighter(highlighters[highlighter_menu->get_item_text(p_idx)]); + EditorSettings::get_singleton()->set_project_metadata("script_text_editor", "syntax_highlighter", p_idx); } void ScriptTextEditor::_bind_methods() { diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp index 3bf4140591..4ff7046a35 100644 --- a/editor/plugins/text_editor.cpp +++ b/editor/plugins/text_editor.cpp @@ -66,6 +66,7 @@ void TextEditor::_change_syntax_highlighter(int p_idx) { el = el->next(); } set_syntax_highlighter(highlighters[highlighter_menu->get_item_text(p_idx)]); + EditorSettings::get_singleton()->set_project_metadata("text_editor", "syntax_highlighter", p_idx); } void TextEditor::_load_theme_settings() { @@ -298,7 +299,7 @@ void TextEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_READY: _load_theme_settings(); - set_syntax_highlighter(NULL); + _change_syntax_highlighter(EditorSettings::get_singleton()->get_project_metadata("text_editor", "syntax_highlighter", 0)); break; } } |