summaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2016-03-14 17:12:15 +0100
committerRémi Verschelde <remi@verschelde.fr>2016-03-14 17:12:15 +0100
commitc30bebd1d3d10f705eae339a684e439edc052195 (patch)
treeaa1a3cd550b5bd1ba6a18261230b841a2be16bc6 /tools/editor
parentad29ee328d5d4f1e08fb20248aa4a8ae5fd6c380 (diff)
parent9234bd3ff9a3ff025368a1882ccfb91ca1b96ff1 (diff)
Merge pull request #4017 from Paulb23/set_tab_size
Added configurable tab size in the text editor.
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/editor_settings.cpp3
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp2
2 files changed, 5 insertions, 0 deletions
diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp
index fda51423d2..1133acb48c 100644
--- a/tools/editor/editor_settings.cpp
+++ b/tools/editor/editor_settings.cpp
@@ -406,6 +406,9 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
set("text_editor/scroll_past_end_of_file", false);
+ set("text_editor/tab_size", 4);
+ hints["text_editor/tab_size"]=PropertyInfo(Variant::INT,"text_editor/tab_size",PROPERTY_HINT_RANGE,"1, 64, 1"); // size of 0 crashes.
+
set("text_editor/idle_parse_delay",2);
set("text_editor/create_signal_callbacks",true);
set("text_editor/autosave_interval_secs",0);
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index 76c64beb61..03db293959 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -1930,6 +1930,7 @@ void ScriptEditor::edit(const Ref<Script>& p_script) {
ste->get_text_edit()->set_tooltip_request_func(this,"_get_debug_tooltip",ste);
ste->get_text_edit()->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/scroll_past_end_of_file"));
ste->get_text_edit()->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/auto_brace_complete"));
+ ste->get_text_edit()->set_tab_size(EditorSettings::get_singleton()->get("text_editor/tab_size"));
ste->get_text_edit()->set_callhint_settings(
EditorSettings::get_singleton()->get("text_editor/put_callhint_tooltip_below_current_line"),
EditorSettings::get_singleton()->get("text_editor/callhint_tooltip_offset"));
@@ -2067,6 +2068,7 @@ void ScriptEditor::_editor_settings_changed() {
ste->get_text_edit()->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/auto_brace_complete"));
ste->get_text_edit()->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/scroll_past_end_of_file"));
+ ste->get_text_edit()->set_tab_size(EditorSettings::get_singleton()->get("text_editor/tab_size"));
}
}