mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Add settings for single-quotes on completion
This commit is contained in:
@@ -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() {
|
||||
@@ -121,6 +125,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")) {
|
||||
|
||||
@@ -134,7 +140,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
|
||||
|
||||
Reference in New Issue
Block a user