From 194bc53e076837ecf56e2b8b1a52ecf638070129 Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Tue, 10 Jul 2007 11:57:07 -0500 Subject: [PATCH] Made tab width a preferences item --- moo/mooedit/mooeditprefs.c | 5 ++++- moo/mooedit/mooeditprefs.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/moo/mooedit/mooeditprefs.c b/moo/mooedit/mooeditprefs.c index 669a04ab..934eae5d 100644 --- a/moo/mooedit/mooeditprefs.c +++ b/moo/mooedit/mooeditprefs.c @@ -86,6 +86,7 @@ _moo_edit_init_prefs (void) NEW_KEY_BOOL (MOO_EDIT_PREFS_SPACES_NO_TABS, FALSE); NEW_KEY_INT (MOO_EDIT_PREFS_INDENT_WIDTH, 8); + NEW_KEY_INT (MOO_EDIT_PREFS_TAB_WIDTH, 8); NEW_KEY_ENUM (MOO_EDIT_PREFS_TAB_KEY_ACTION, MOO_TYPE_TEXT_TAB_KEY_ACTION, MOO_TEXT_TAB_KEY_INDENT); NEW_KEY_BOOL (MOO_EDIT_PREFS_AUTO_INDENT, TRUE); @@ -131,11 +132,12 @@ void _moo_edit_update_global_config (void) { gboolean use_tabs, strip, show_line_numbers; - int indent_width; + int indent_width, tab_width; GtkWrapMode wrap_mode; use_tabs = !get_bool (MOO_EDIT_PREFS_SPACES_NO_TABS); indent_width = get_int (MOO_EDIT_PREFS_INDENT_WIDTH); + tab_width = get_int (MOO_EDIT_PREFS_TAB_WIDTH); strip = get_bool (MOO_EDIT_PREFS_STRIP); show_line_numbers = get_bool (MOO_EDIT_PREFS_SHOW_LINE_NUMBERS); @@ -154,6 +156,7 @@ _moo_edit_update_global_config (void) moo_edit_config_set_global (MOO_EDIT_CONFIG_SOURCE_AUTO, "indent-use-tabs", use_tabs, "indent-width", indent_width, + "tab-width", tab_width, "strip", strip, "show-line-numbers", show_line_numbers, "wrap-mode", wrap_mode, diff --git a/moo/mooedit/mooeditprefs.h b/moo/mooedit/mooeditprefs.h index 33c0606d..5b042bb6 100644 --- a/moo/mooedit/mooeditprefs.h +++ b/moo/mooedit/mooeditprefs.h @@ -33,6 +33,7 @@ const char *moo_edit_setting (const char *setting_name); #define MOO_EDIT_PREFS_TAB_KEY_ACTION "tab_key_action" #define MOO_EDIT_PREFS_SPACES_NO_TABS "spaces_instead_of_tabs" #define MOO_EDIT_PREFS_INDENT_WIDTH "indent_width" +#define MOO_EDIT_PREFS_TAB_WIDTH "tab_width" #define MOO_EDIT_PREFS_AUTO_INDENT "auto_indent" #define MOO_EDIT_PREFS_BACKSPACE_INDENTS "backspace_indents"