Explorar o código

Fix script highlighting for classes that begin with "_"

Franklin Sobrinho %!s(int64=9) %!d(string=hai) anos
pai
achega
56bc005643
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      tools/editor/plugins/script_editor_plugin.cpp

+ 5 - 1
tools/editor/plugins/script_editor_plugin.cpp

@@ -327,7 +327,11 @@ void ScriptTextEditor::_load_theme_settings() {
 
 	for(List<StringName>::Element *E=types.front();E;E=E->next()) {
 
-		get_text_edit()->add_keyword_color(E->get(),type_color);
+		String n = E->get();
+		if (n.begins_with("_"))
+			n = n.substr(1, n.length());
+
+		get_text_edit()->add_keyword_color(n,type_color);
 	}
 
 	//colorize comments