diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-05-17 21:24:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-17 21:24:47 +0200 |
commit | d5c1de784ccd622ce9d62613eaf604a8b163d592 (patch) | |
tree | f0568dd5189af36e664ad7d3ba7a82ec322cfab0 /editor | |
parent | f1ef5820366560bffae1a3c761cf6359bd90cba2 (diff) | |
parent | 995bcd6218c6a33b89fa2456a9cf8903ecfe5c66 (diff) |
Merge pull request #61115 from KoBeWi/don't_quote_me_on_that
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index e7b4aa6b68..ee8767e6a6 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1586,7 +1586,7 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data } else { for (int i = 0; i < nodes.size(); i++) { if (i > 0) { - text_to_drop += ","; + text_to_drop += ", "; } NodePath np = nodes[i]; @@ -1596,7 +1596,13 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data } 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; } } |