summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-04-30 14:58:33 +0200
committerGitHub <noreply@github.com>2019-04-30 14:58:33 +0200
commit9dc9434b1bcde48259fa68066a7a3e2cff5d5eab (patch)
tree10e597c0df84b6eb358e56a408800440535b12ce /core
parentc991379b81e660e6c9d28620d61b87e9c0cb5233 (diff)
parentca1935d6f776a789dda9e046e5624ba0715e2671 (diff)
Merge pull request #24437 from mateusfccp/single_quotes_option
Add settings for single-quotes on completion
Diffstat (limited to 'core')
-rw-r--r--core/os/input.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/os/input.cpp b/core/os/input.cpp
index 63bf1db499..f04d4a1b3e 100644
--- a/core/os/input.cpp
+++ b/core/os/input.cpp
@@ -34,6 +34,10 @@
#include "core/os/os.h"
#include "core/project_settings.h"
+#ifdef TOOLS_ENABLED
+#include "editor/editor_settings.h"
+#endif
+
Input *Input::singleton = NULL;
Input *Input::get_singleton() {
@@ -123,6 +127,8 @@ void Input::_bind_methods() {
void Input::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
#ifdef TOOLS_ENABLED
+ const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", 0) ? "'" : "\"";
+
String pf = p_function;
if (p_idx == 0 && (pf == "is_action_pressed" || pf == "action_press" || pf == "action_release" || pf == "is_action_just_pressed" || pf == "is_action_just_released" || pf == "get_action_strength")) {
@@ -136,7 +142,7 @@ void Input::get_argument_options(const StringName &p_function, int p_idx, List<S
continue;
String name = pi.name.substr(pi.name.find("/") + 1, pi.name.length());
- r_options->push_back("\"" + name + "\"");
+ r_options->push_back(quote_style + name + quote_style);
}
}
#endif