diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-04-30 14:58:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-30 14:58:33 +0200 |
commit | 9dc9434b1bcde48259fa68066a7a3e2cff5d5eab (patch) | |
tree | 10e597c0df84b6eb358e56a408800440535b12ce /scene/main/node.cpp | |
parent | c991379b81e660e6c9d28620d61b87e9c0cb5233 (diff) | |
parent | ca1935d6f776a789dda9e046e5624ba0715e2671 (diff) |
Merge pull request #24437 from mateusfccp/single_quotes_option
Add settings for single-quotes on completion
Diffstat (limited to 'scene/main/node.cpp')
-rw-r--r-- | scene/main/node.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 0465ffe442..e80de68e3b 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -39,6 +39,10 @@ #include "scene/scene_string_names.h" #include "viewport.h" +#ifdef TOOLS_ENABLED +#include "editor/editor_settings.h" +#endif + VARIANT_ENUM_CAST(Node::PauseMode); int Node::orphan_node_count = 0; @@ -2637,10 +2641,16 @@ NodePath Node::get_import_path() const { static void _add_nodes_to_options(const Node *p_base, const Node *p_node, List<String> *r_options) { +#ifdef TOOLS_ENABLED + const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", 0) ? "'" : "\""; +#else + const String quote_style = "\""; +#endif + if (p_node != p_base && !p_node->get_owner()) return; String n = p_base->get_path_to(p_node); - r_options->push_back("\"" + n + "\""); + r_options->push_back(quote_style + n + quote_style); for (int i = 0; i < p_node->get_child_count(); i++) { _add_nodes_to_options(p_base, p_node->get_child(i), r_options); } |