1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Add editor settings for autocompletion with NodePath and StringName

This commit is contained in:
VolTer
2022-10-06 22:08:01 +02:00
committed by MewPurPur
parent fe01776f05
commit de8b6f7a3c
7 changed files with 38 additions and 4 deletions

View File

@@ -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);