diff --git a/edit/edit.c b/edit/edit.c index d365ea542..74dfbae4b 100644 --- a/edit/edit.c +++ b/edit/edit.c @@ -68,7 +68,6 @@ int edit_key_emulation = EDIT_KEY_EMULATION_NORMAL; int option_word_wrap_line_length = 72; int option_typewriter_wrap = 0; int option_auto_para_formatting = 0; -int option_tab_spacing = 8; int option_fill_tabs_with_spaces = 0; int option_return_does_auto_indent = 1; int option_backspace_through_tabs = 0; diff --git a/edit/edit.h b/edit/edit.h index 8bf2e8d4f..b406bd81c 100644 --- a/edit/edit.h +++ b/edit/edit.h @@ -45,7 +45,6 @@ typedef struct WEdit WEdit; extern int option_word_wrap_line_length; extern int option_typewriter_wrap; extern int option_auto_para_formatting; -extern int option_tab_spacing; extern int option_fill_tabs_with_spaces; extern int option_return_does_auto_indent; extern int option_backspace_through_tabs; diff --git a/edit/editoptions.c b/edit/editoptions.c index a3d62763f..fbf0a3a55 100644 --- a/edit/editoptions.c +++ b/edit/editoptions.c @@ -36,6 +36,7 @@ #include "edit-impl.h" #include "../src/dialog.h" /* B_CANCEL */ #include "../src/wtools.h" /* QuickDialog */ +#include "../src/main.h" /* option_tab_spacing */ #define OPT_DLG_H 21 #define OPT_DLG_W 72 diff --git a/edit/wordproc.c b/edit/wordproc.c index 7da91d172..e3c30552b 100644 --- a/edit/wordproc.c +++ b/edit/wordproc.c @@ -41,6 +41,7 @@ #include "edit-impl.h" #include "edit-widget.h" +#include "../src/main.h" /* option_tab_spacing */ #define tab_width option_tab_spacing diff --git a/src/main.c b/src/main.c index 48a365388..fdcf57e54 100644 --- a/src/main.c +++ b/src/main.c @@ -254,6 +254,9 @@ int update_prompt = 0; /* The home directory */ const char *home_dir = NULL; +/* Tab size */ +int option_tab_spacing = 8; + /* The value of the other directory, only used when loading the setup */ char *other_dir = NULL; diff --git a/src/main.h b/src/main.h index e147dc899..4dcb1fb4a 100644 --- a/src/main.h +++ b/src/main.h @@ -35,6 +35,8 @@ extern int clear_before_exec; extern char *other_dir; extern int mouse_move_pages; +extern int option_tab_spacing; + #ifdef HAVE_CHARSET extern int source_codepage; extern int display_codepage; diff --git a/src/viewer/nroff.c b/src/viewer/nroff.c index 57e4b52b8..7675bf3a9 100644 --- a/src/viewer/nroff.c +++ b/src/viewer/nroff.c @@ -147,7 +147,7 @@ mcview_display_nroff (mcview_t * view) if (c == '\t') { off_t line, column; mcview_offset_to_coord (view, &line, &column, from); - col += (8 - column % 8); + col += (option_tab_spacing - col % option_tab_spacing); if (view->text_wrap_mode && col >= width && width != 0) { row += col / width; col %= width; diff --git a/src/viewer/plain.c b/src/viewer/plain.c index 9b1aeeee3..aa57027e3 100644 --- a/src/viewer/plain.c +++ b/src/viewer/plain.c @@ -118,7 +118,7 @@ mcview_display_text (mcview_t * view) if (c == '\t') { off_t line, column; mcview_offset_to_coord (view, &line, &column, from); - col += (8 - column % 8); + col += (option_tab_spacing - col % option_tab_spacing); if (view->text_wrap_mode && col >= width && width != 0) { row += col / width; col %= width;