Ticket #1664 (Viewer: incorrect tabs alignment)

fix tabs alignment. Variable option_tab_spacing instead hardcoded '8' are used.

Signed-off-by: Ilia Maslakov <il.smind@google.com>
This commit is contained in:
Ilia Maslakov 2009-10-07 06:21:35 +00:00
parent 1c4f8b1a0e
commit 93f8b96b32
8 changed files with 9 additions and 4 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;