summaryrefslogtreecommitdiff
path: root/editor/plugins/script_text_editor.cpp
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2021-07-03 01:41:39 +0200
committerkobewi <kobewi4e@gmail.com>2021-07-03 13:03:20 +0200
commit5e593dda9b24af44d78a99aa330e5d3384ab6272 (patch)
treeaaca9bbf3e199757478b30654a2b01f54b386ff7 /editor/plugins/script_text_editor.cpp
parenta8fb450b3ce568fa8e3c9c013821f9046b9a0396 (diff)
Support single quote when dropping files to script
Diffstat (limited to 'editor/plugins/script_text_editor.cpp')
-rw-r--r--editor/plugins/script_text_editor.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index bec2814462..cc0fbcc634 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -1444,6 +1444,7 @@ 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;
@@ -1454,9 +1455,9 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data
}
if (preload) {
- text_to_drop += "preload(\"" + String(files[i]).c_escape() + "\")";
+ text_to_drop += "preload(" + String(files[i]).c_escape().quote(quote_style) + ")";
} else {
- text_to_drop += "\"" + String(files[i]).c_escape() + "\"";
+ text_to_drop += String(files[i]).c_escape().quote(quote_style);
}
}