mirror of
https://github.com/godotengine/godot.git
synced 2024-11-26 14:13:10 +00:00
Merge pull request #51655 from RevoluPowered/improve-gdscript-code-editor-performance
Improve GDScript Editor performance
This commit is contained in:
commit
b458feba24
@ -1579,17 +1579,10 @@ void CodeTextEditor::_update_text_editor_theme() {
|
||||
}
|
||||
|
||||
void CodeTextEditor::_on_settings_change() {
|
||||
if (settings_changed) {
|
||||
return;
|
||||
}
|
||||
|
||||
settings_changed = true;
|
||||
MessageQueue::get_singleton()->push_callable(callable_mp(this, &CodeTextEditor::_apply_settings_change));
|
||||
_apply_settings_change();
|
||||
}
|
||||
|
||||
void CodeTextEditor::_apply_settings_change() {
|
||||
settings_changed = false;
|
||||
|
||||
_update_text_editor_theme();
|
||||
|
||||
font_size = EditorSettings::get_singleton()->get("interface/editor/code_font_size");
|
||||
|
@ -162,8 +162,6 @@ class CodeTextEditor : public VBoxContainer {
|
||||
int error_line;
|
||||
int error_column;
|
||||
|
||||
bool settings_changed = false;
|
||||
|
||||
void _on_settings_change();
|
||||
void _apply_settings_change();
|
||||
|
||||
|
@ -467,7 +467,7 @@ void GDScriptSyntaxHighlighter::_update_cache() {
|
||||
List<StringName> global_classes;
|
||||
ScriptServer::get_global_class_list(&global_classes);
|
||||
for (const StringName &E : global_classes) {
|
||||
keywords[String(E)] = usertype_color;
|
||||
keywords[E] = usertype_color;
|
||||
}
|
||||
|
||||
/* Autoloads. */
|
||||
@ -486,7 +486,7 @@ void GDScriptSyntaxHighlighter::_update_cache() {
|
||||
List<String> core_types;
|
||||
gdscript->get_core_type_words(&core_types);
|
||||
for (const String &E : core_types) {
|
||||
keywords[E] = basetype_color;
|
||||
keywords[StringName(E)] = basetype_color;
|
||||
}
|
||||
|
||||
/* Reserved words. */
|
||||
@ -496,9 +496,9 @@ void GDScriptSyntaxHighlighter::_update_cache() {
|
||||
gdscript->get_reserved_words(&keyword_list);
|
||||
for (const String &E : keyword_list) {
|
||||
if (gdscript->is_control_flow_keyword(E)) {
|
||||
keywords[E] = control_flow_keyword_color;
|
||||
keywords[StringName(E)] = control_flow_keyword_color;
|
||||
} else {
|
||||
keywords[E] = keyword_color;
|
||||
keywords[StringName(E)] = keyword_color;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,8 +47,8 @@ private:
|
||||
Vector<ColorRegion> color_regions;
|
||||
Map<int, int> color_region_cache;
|
||||
|
||||
Dictionary keywords;
|
||||
Dictionary member_keywords;
|
||||
HashMap<StringName, Color> keywords;
|
||||
HashMap<StringName, Color> member_keywords;
|
||||
|
||||
enum Type {
|
||||
NONE,
|
||||
|
Loading…
Reference in New Issue
Block a user