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/code_editor.cpp | |
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/code_editor.cpp')
-rw-r--r-- | tools/editor/code_editor.cpp | 24 |
1 files changed, 16 insertions, 8 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"); } |