summaryrefslogtreecommitdiffstats
path: root/editor/plugins/script_text_editor.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-03-24 01:11:42 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-03-24 01:11:42 +0100
commit0e966b39b410ac4ca2be7400b14f23d5859bdf57 (patch)
tree3fea0197457bbf4e1a8ac8e8c797060663d4aa71 /editor/plugins/script_text_editor.cpp
parentfe01776f05b1787b28b4a270d53037a3c25f4ca2 (diff)
parentde8b6f7a3c1254254fd1079ef9a0a4614cc0dfc3 (diff)
downloadredot-engine-0e966b39b410ac4ca2be7400b14f23d5859bdf57.tar.gz
Merge pull request #66481 from MewPurPur/auto-stringname-nodepath
Add editor settings for autocompletion with NodePath and StringName
Diffstat (limited to 'editor/plugins/script_text_editor.cpp')
-rw-r--r--editor/plugins/script_text_editor.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index 13b1c4b6ac..750e4d263f 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -1946,9 +1946,12 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data
if (d.has("type") && String(d["type"]) == "obj_property") {
te->remove_secondary_carets();
+
+ bool add_literal = EDITOR_GET("text_editor/completion/add_node_path_literals");
+ String text_to_drop = add_literal ? "^" : "";
// It is unclear whether properties may contain single or double quotes.
// Assume here that double-quotes may not exist. We are escaping single-quotes if necessary.
- const String text_to_drop = _quote_drop_data(String(d["property"]));
+ text_to_drop += _quote_drop_data(String(d["property"]));
te->set_caret_line(row);
te->set_caret_column(col);