diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-08-13 21:49:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-13 21:49:06 +0200 |
commit | 14a2e598751405a99278d268b1b2ccdb0398826a (patch) | |
tree | b91fdc3d9f27b722563187d139f9c660deac463a /editor/plugins | |
parent | 761eb7e06a25f61037ebbb62e57058c5ec2866a2 (diff) | |
parent | 81512a3732dd2cad3989fa94c0ec9261c6930030 (diff) |
Merge pull request #51642 from akien-mga/cleanup-use_single_quotes
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index e06e6eefff..1d7592d2c3 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1420,10 +1420,11 @@ static Node *_find_script_node(Node *p_edited_scene, Node *p_current_node, const } void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) { + const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\""; + Dictionary d = p_data; CodeEdit *te = code_editor->get_text_editor(); - Point2i pos = te->get_line_column_at_pos(p_point); int row = pos.y; int col = pos.x; @@ -1445,7 +1446,6 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data } if (d.has("type") && (String(d["type"]) == "files" || String(d["type"]) == "files_and_dirs")) { - const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", false) ? "'" : "\""; Array files = d["files"]; String text_to_drop; @@ -1489,7 +1489,7 @@ 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() + "\""; + text_to_drop += path.c_escape().quote(quote_style); } te->set_caret_line(row); @@ -1498,7 +1498,6 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data } if (d.has("type") && String(d["type"]) == "obj_property") { - const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", false) ? "'" : "\""; const String text_to_drop = String(d["property"]).c_escape().quote(quote_style); te->set_caret_line(row); |