diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2019-04-25 23:48:59 +0200 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2019-04-26 00:01:20 +0200 |
commit | 2041e21eb5eb8b6473c337a7191069f4f8853c61 (patch) | |
tree | 695472ff82ccef995ae6836984214ea951b2e70c | |
parent | cce2e4b07c1c4b6f2f9d72cac340d9f9ecbb790e (diff) |
Allow floating-point values in the idle parse delay editor setting
This also makes value changes effective without having to restart
the editor.
-rw-r--r-- | editor/code_editor.cpp | 4 | ||||
-rw-r--r-- | editor/editor_settings.cpp | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index a9ec776693..d097d34c97 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -1289,6 +1289,8 @@ void CodeTextEditor::_on_settings_change() { text_editor->set_callhint_settings( EDITOR_DEF("text_editor/completion/put_callhint_tooltip_below_current_line", true), EDITOR_DEF("text_editor/completion/callhint_tooltip_offset", Vector2())); + + idle->set_wait_time(EDITOR_DEF("text_editor/completion/idle_parse_delay", 2.0)); } void CodeTextEditor::_text_changed_idle_timeout() { @@ -1403,7 +1405,7 @@ CodeTextEditor::CodeTextEditor() { idle = memnew(Timer); add_child(idle); idle->set_one_shot(true); - idle->set_wait_time(EDITOR_DEF("text_editor/completion/idle_parse_delay", 2)); + idle->set_wait_time(EDITOR_DEF("text_editor/completion/idle_parse_delay", 2.0)); code_complete_timer = memnew(Timer); add_child(code_complete_timer); diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 54bd9cae20..9e9d2cf47a 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -459,7 +459,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { _initial_set("text_editor/cursor/right_click_moves_caret", true); // Completion - _initial_set("text_editor/completion/idle_parse_delay", 2); + _initial_set("text_editor/completion/idle_parse_delay", 2.0); + hints["text_editor/completion/idle_parse_delay"] = PropertyInfo(Variant::REAL, "text_editor/completion/idle_parse_delay", PROPERTY_HINT_RANGE, "0.1, 10, 0.01"); _initial_set("text_editor/completion/auto_brace_complete", false); _initial_set("text_editor/completion/put_callhint_tooltip_below_current_line", true); _initial_set("text_editor/completion/callhint_tooltip_offset", Vector2()); |