You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Fixed syntax highlighting setting not being saved
Fixed syntax highlighting setting not being saved
This commit is contained in:
@@ -317,6 +317,7 @@ void ScriptTextEditor::_notification(int p_what) {
|
|||||||
switch (p_what) {
|
switch (p_what) {
|
||||||
case NOTIFICATION_READY:
|
case NOTIFICATION_READY:
|
||||||
_load_theme_settings();
|
_load_theme_settings();
|
||||||
|
_change_syntax_highlighter(EditorSettings::get_singleton()->get_project_metadata("script_text_editor", "syntax_highlighter", 0));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1058,6 +1059,7 @@ void ScriptTextEditor::_change_syntax_highlighter(int p_idx) {
|
|||||||
}
|
}
|
||||||
// highlighter_menu->set_item_checked(p_idx, true);
|
// highlighter_menu->set_item_checked(p_idx, true);
|
||||||
set_syntax_highlighter(highlighters[highlighter_menu->get_item_text(p_idx)]);
|
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() {
|
void ScriptTextEditor::_bind_methods() {
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ void TextEditor::_change_syntax_highlighter(int p_idx) {
|
|||||||
el = el->next();
|
el = el->next();
|
||||||
}
|
}
|
||||||
set_syntax_highlighter(highlighters[highlighter_menu->get_item_text(p_idx)]);
|
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() {
|
void TextEditor::_load_theme_settings() {
|
||||||
@@ -298,7 +299,7 @@ void TextEditor::_notification(int p_what) {
|
|||||||
switch (p_what) {
|
switch (p_what) {
|
||||||
case NOTIFICATION_READY:
|
case NOTIFICATION_READY:
|
||||||
_load_theme_settings();
|
_load_theme_settings();
|
||||||
set_syntax_highlighter(NULL);
|
_change_syntax_highlighter(EditorSettings::get_singleton()->get_project_metadata("text_editor", "syntax_highlighter", 0));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user