mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 10:04:32 +03:00
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:
parent
1c4f8b1a0e
commit
93f8b96b32
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user