Skip to content

Commit

Permalink
Merge pull request #61148 from Jummit/drop-unique-nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga authored May 18, 2022
2 parents e22255e + 1101f6c commit e786862
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions editor/plugins/script_text_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1568,7 +1568,12 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data
continue;
}

String path = sn->get_path_to(node);
String path;
if (node->is_unique_name_in_owner()) {
path = "%" + node->get_name();
} else {
path = sn->get_path_to(node);
}
for (const String &segment : path.split("/")) {
if (!segment.is_valid_identifier()) {
path = path.c_escape().quote(quote_style);
Expand All @@ -1595,7 +1600,12 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data
continue;
}

String path = sn->get_path_to(node);
String path;
if (node->is_unique_name_in_owner()) {
path = "%" + node->get_name();
} else {
path = sn->get_path_to(node);
}
for (const String &segment : path.split("/")) {
if (!segment.is_valid_identifier()) {
path = path.c_escape().quote(quote_style);
Expand Down

0 comments on commit e786862

Please sign in to comment.