1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-16 14:00:40 +00:00

Include quotes conditionally for dropped paths

This commit is contained in:
kobewi
2022-05-17 14:56:16 +02:00
parent 1d5e662766
commit 995bcd6218

View File

@@ -1596,7 +1596,13 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data
} }
String path = sn->get_path_to(node); String path = sn->get_path_to(node);
text_to_drop += path.c_escape().quote(quote_style); for (const String &segment : path.split("/")) {
if (!segment.is_valid_identifier()) {
path = path.c_escape().quote(quote_style);
break;
}
}
text_to_drop += "$" + path;
} }
} }