Fix the text editor confusing resource files of class JSON with json files.

This commit is contained in:
jroprohehe 2025-08-12 16:22:29 +03:00
parent ca452113d4
commit e4763e6329

View file

@ -4645,7 +4645,11 @@ bool ScriptEditorPlugin::handles(Object *p_object) const {
}
if (Object::cast_to<JSON>(p_object)) {
return true;
// This is here to stop resource files of class JSON from getting confused
// with json files and being opened in the text editor.
if (Object::cast_to<JSON>(p_object)->get_path().get_extension().to_lower() == "json") {
return true;
}
}
return p_object->is_class("Script");