summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
authorMateus Felipe C. C. Pinto <mateusfccp@gmail.com>2018-12-17 23:53:54 -0200
committerMateus Felipe C. C. Pinto <mateusfccp@gmail.com>2018-12-18 12:48:36 -0200
commitca1935d6f776a789dda9e046e5624ba0715e2671 (patch)
tree4f8ac3e95c088f1ae8e30b11dbd8dddb1cdc0b78 /scene/main
parent0cff752be1f6c6a61ad72bcdf340c06d08277081 (diff)
Add settings for single-quotes on completion
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/node.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index ea50e7289d..c0f378543c 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);
void Node::_notification(int p_notification) {
@@ -2600,10 +2604,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);
}