diff options
author | reduz <reduzio@gmail.com> | 2014-05-02 15:54:01 -0300 |
---|---|---|
committer | reduz <reduzio@gmail.com> | 2014-05-02 15:54:01 -0300 |
commit | 3c17e0c91548299b60a6d3998eadb303418512cc (patch) | |
tree | ecb0bf454825649076db1b99d614f353cff0e4a0 /tools/editor | |
parent | f1d3b30a45f31c217929ec86b010736feed1714c (diff) | |
parent | 53b2879e1703062f1f87b6cfc3ba140aa019fde4 (diff) |
Merge pull request #331 from jonyrock/pair_symbols_tool
pair symbols tool basic imp
Diffstat (limited to 'tools/editor')
-rw-r--r-- | tools/editor/code_editor.cpp | 24 | ||||
-rw-r--r-- | tools/editor/code_editor.h | 4 | ||||
-rw-r--r-- | tools/editor/editor_settings.cpp | 1 |
3 files changed, 19 insertions, 10 deletions
diff --git a/tools/editor/code_editor.cpp b/tools/editor/code_editor.cpp index ea87ac625b..a780c0173e 100644 --- a/tools/editor/code_editor.cpp +++ b/tools/editor/code_editor.cpp @@ -510,18 +510,26 @@ void CodeTextEditor::set_error(const String& p_error) { } -void CodeTextEditor::_update_font() { - - String editor_font = EditorSettings::get_singleton()->get("text_editor/font"); +void CodeTextEditor::_on_settings_change() { + + // FONTS + String editor_font = EDITOR_DEF("text_editor/font", ""); + bool font_overrode = false; if (editor_font!="") { Ref<Font> fnt = ResourceLoader::load(editor_font); if (fnt.is_valid()) { text_editor->add_font_override("font",fnt); - return; + font_overrode = true; } } - - text_editor->add_font_override("font",get_font("source","Fonts")); + if(!font_overrode) + text_editor->add_font_override("font",get_font("source","Fonts")); + + // AUTO BRACE COMPLETION + text_editor->set_auto_brace_completion( + EDITOR_DEF("text_editor/auto_brace_complete", false) + ); + } void CodeTextEditor::_text_changed_idle_timeout() { @@ -541,7 +549,7 @@ void CodeTextEditor::_bind_methods() { ObjectTypeDB::bind_method("_line_col_changed",&CodeTextEditor::_line_col_changed); ObjectTypeDB::bind_method("_text_changed",&CodeTextEditor::_text_changed); - ObjectTypeDB::bind_method("_update_font",&CodeTextEditor::_update_font); + ObjectTypeDB::bind_method("_on_settings_change",&CodeTextEditor::_on_settings_change); ObjectTypeDB::bind_method("_text_changed_idle_timeout",&CodeTextEditor::_text_changed_idle_timeout); ObjectTypeDB::bind_method("_complete_request",&CodeTextEditor::_complete_request); } @@ -586,5 +594,5 @@ CodeTextEditor::CodeTextEditor() { text_editor->set_completion(true,cs); idle->connect("timeout", this,"_text_changed_idle_timeout"); - EditorSettings::get_singleton()->connect("settings_changed",this,"_update_font"); + EditorSettings::get_singleton()->connect("settings_changed",this,"_on_settings_change"); } diff --git a/tools/editor/code_editor.h b/tools/editor/code_editor.h index 5a588d2ccb..0ca0e1e234 100644 --- a/tools/editor/code_editor.h +++ b/tools/editor/code_editor.h @@ -55,7 +55,7 @@ public: void set_text_editor(TextEdit *p_text_editor); - GotoLineDialog(); + GotoLineDialog(); }; @@ -131,7 +131,7 @@ class CodeTextEditor : public Control { Label *error; - void _update_font(); + void _on_settings_change(); void _complete_request(const String& p_request,int p_line); protected: diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp index e09e090b16..4a58b42a2e 100644 --- a/tools/editor/editor_settings.cpp +++ b/tools/editor/editor_settings.cpp @@ -402,6 +402,7 @@ void EditorSettings::_load_defaults() { set("text_editor/create_signal_callbacks",true); set("text_editor/autosave_interval_seconds",60); set("text_editor/font",""); + set("text_editor/auto_brace_complete", false); hints["text_editor/font"]=PropertyInfo(Variant::STRING,"text_editor/font",PROPERTY_HINT_GLOBAL_FILE,"*.fnt"); |