1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Fix script editor wrongly replaces and quotes non-ASCII letters

This commit is contained in:
Haoyu Qiu
2024-09-22 19:31:58 +08:00
parent e4e024ab88
commit a751c05b15
5 changed files with 46 additions and 8 deletions

View File

@@ -97,8 +97,8 @@ Ref<Script> GDScriptLanguage::make_template(const String &p_template, const Stri
}
processed_template = processed_template.replace("_BASE_", p_base_class_name)
.replace("_CLASS_SNAKE_CASE_", p_class_name.to_snake_case().validate_ascii_identifier())
.replace("_CLASS_", p_class_name.to_pascal_case().validate_ascii_identifier())
.replace("_CLASS_SNAKE_CASE_", p_class_name.to_snake_case().validate_unicode_identifier())
.replace("_CLASS_", p_class_name.to_pascal_case().validate_unicode_identifier())
.replace("_TS_", _get_indentation());
scr->set_source_code(processed_template);
return scr;