Skip to content

Commit e4763e6

Browse files
committed
Fix the text editor confusing resource files of class JSON with json files.
1 parent ca45211 commit e4763e6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

editor/script/script_editor_plugin.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4645,7 +4645,11 @@ bool ScriptEditorPlugin::handles(Object *p_object) const {
46454645
}
46464646

46474647
if (Object::cast_to<JSON>(p_object)) {
4648-
return true;
4648+
// This is here to stop resource files of class JSON from getting confused
4649+
// with json files and being opened in the text editor.
4650+
if (Object::cast_to<JSON>(p_object)->get_path().get_extension().to_lower() == "json") {
4651+
return true;
4652+
}
46494653
}
46504654

46514655
return p_object->is_class("Script");

0 commit comments

Comments
 (0)