1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-22 15:06:45 +00:00

Include quotes conditionally for dropped paths

(cherry picked from commit 995bcd6218)
This commit is contained in:
kobewi
2022-05-17 14:56:16 +02:00
committed by Rémi Verschelde
parent 77a9f3d4d8
commit 07953346fa

View File

@@ -1592,7 +1592,14 @@ 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); Vector<String> segments = path.split("/");
for (int j = 0; j < segments.size(); j++) {
if (!segments[j].is_valid_identifier()) {
path = path.c_escape().quote(quote_style);
break;
}
}
text_to_drop += "$" + path;
} }
} }