Ticket #1384: 6.patch

File 6.patch, 7.4 KB (added by vda, 10 years ago)

Fix (diffed against 2-day old git)

  • edit/editdraw.c

    diff -d -urpN mc.5/edit/editdraw.c mc.6/edit/editdraw.c
    old new edit_draw_this_line (WEdit *edit, long b 
    442442                case '\t': 
    443443                    i = TAB_SIZE - ((int) col % TAB_SIZE); 
    444444                    col += i; 
    445                     if (use_colors && visible_tabs) { 
     445                    if (use_colors && (visible_tabs || (visible_tws && q >= tws))) { 
    446446                        if (p->style & MOD_MARKED) 
    447447                            c = (p->style); 
    448448                        else 
  • edit/editoptions.c

    diff -d -urpN mc.5/edit/editoptions.c mc.6/edit/editoptions.c
    old new  
    3838#include "../src/dialog.h"      /* B_CANCEL */ 
    3939#include "../src/wtools.h"      /* QuickDialog */ 
    4040 
    41 #define OPT_DLG_H 19 
     41#define OPT_DLG_H 21 
    4242#define OPT_DLG_W 72 
    4343 
    4444static const char *key_emu_str[] = 
    edit_options_dialog (void) 
    6767    int toption_save_position = option_save_position; 
    6868    int tedit_confirm_save = edit_confirm_save; 
    6969    int tedit_syntax_highlighting = option_syntax_highlighting; 
     70    int tedit_visible_tabs = visible_tabs; 
     71    int tedit_visible_tws = visible_tws; 
    7072    int tedit_persistent_selections = option_persistent_selections; 
    7173    int toption_return_does_auto_indent = option_return_does_auto_indent; 
    7274    int toption_backspace_through_tabs = option_backspace_through_tabs; 
    edit_options_dialog (void) 
    8183        {quick_button, 2, 10, OPT_DLG_H - 3, OPT_DLG_H, N_("&OK"), 0, 
    8284         B_ENTER, 0, 0, NULL, NULL, NULL}, 
    8385        /* 2 */ 
    84         {quick_label, OPT_DLG_W / 2, OPT_DLG_W, OPT_DLG_H - 7, OPT_DLG_H, 
     86        {quick_label, OPT_DLG_W / 2, OPT_DLG_W, OPT_DLG_H - 6, OPT_DLG_H, 
    8587         N_("Word wrap line length: "), 0, 0, 0, 0, NULL, NULL, NULL}, 
    8688        /* 3 */ 
    87         {quick_input, OPT_DLG_W / 2 + 24, OPT_DLG_W, OPT_DLG_H - 7, 
     89        {quick_input, OPT_DLG_W / 2 + 24, OPT_DLG_W, OPT_DLG_H - 6, 
    8890         OPT_DLG_H, "", OPT_DLG_W / 2 - 4 - 24, 0, 0, 0, "edit-word-wrap", NULL, NULL}, 
    8991        /* 4 */ 
    90         {quick_label, OPT_DLG_W / 2, OPT_DLG_W, OPT_DLG_H - 6, OPT_DLG_H, 
     92        {quick_label, OPT_DLG_W / 2, OPT_DLG_W, OPT_DLG_H - 7, OPT_DLG_H, 
    9193         N_("Tab spacing: "), 0, 0, 0, 0, NULL, NULL, NULL}, 
    9294        /* 5 */ 
    93         {quick_input, OPT_DLG_W / 2 + 24, OPT_DLG_W, OPT_DLG_H - 6, 
     95        {quick_input, OPT_DLG_W / 2 + 24, OPT_DLG_W, OPT_DLG_H - 7, 
    9496         OPT_DLG_H, "", OPT_DLG_W / 2 - 4 - 24, 0, 0, 0, 
    9597         "edit-tab-spacing", NULL, NULL}, 
    9698        /* 6 */ 
    edit_options_dialog (void) 
    99101        /* 7 */ 
    100102        {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 10, 
    101103         OPT_DLG_H, N_("Synta&x highlighting"), 8, 0, 0, 0, NULL, NULL, NULL}, 
    102         /* 7 */ 
     104        /* 8 */ 
    103105        {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 11, 
    104          OPT_DLG_H, N_("Save file &position"), 0, 0, 0, 0, NULL, NULL, NULL}, 
     106         OPT_DLG_H, N_("Visible tabs"), 8, 0, 0, 0, NULL, NULL, NULL}, 
    105107        /* 9 */ 
    106108        {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 12, 
    107          OPT_DLG_H, N_("Confir&m before saving"), 6, 0, 0, 0, NULL, NULL, NULL}, 
     109         OPT_DLG_H, N_("Visible trailing spaces"), 8, 0, 0, 0, NULL, NULL, NULL}, 
    108110        /* 10 */ 
    109111        {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 13, 
    110          OPT_DLG_H, N_("Fill tabs with &spaces"), 0, 0, 0, 0, NULL, NULL, NULL}, 
     112         OPT_DLG_H, N_("Save file &position"), 0, 0, 0, 0, NULL, NULL, NULL}, 
    111113        /* 11 */ 
    112114        {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 14, 
    113          OPT_DLG_H, N_("&Return does autoindent"), 0, 0, 0, 0, NULL, NULL, NULL}, 
     115         OPT_DLG_H, N_("Confir&m before saving"), 6, 0, 0, 0, NULL, NULL, NULL}, 
    114116        /* 12 */ 
    115117        {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 15, 
    116          OPT_DLG_H, N_("&Backspace through tabs"), 0, 0, 0, 0, NULL, NULL, NULL}, 
     118         OPT_DLG_H, N_("Fill tabs with &spaces"), 0, 0, 0, 0, NULL, NULL, NULL}, 
    117119        /* 13 */ 
    118120        {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 16, 
    119          OPT_DLG_H, N_("&Fake half tabs"), 0, 0, 0, 0, NULL, NULL, NULL}, 
     121         OPT_DLG_H, N_("&Return does autoindent"), 0, 0, 0, 0, NULL, NULL, NULL}, 
    120122        /* 14 */ 
    121         {quick_radio, 5, OPT_DLG_W, OPT_DLG_H - 9, OPT_DLG_H, "", 3, 0, 0, 
    122          const_cast(char **, wrap_str), "wrapm", NULL, NULL}, 
     123        {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 17, 
     124         OPT_DLG_H, N_("&Backspace through tabs"), 0, 0, 0, 0, NULL, NULL, NULL}, 
    123125        /* 15 */ 
    124         {quick_label, 4, OPT_DLG_W, OPT_DLG_H - 10, OPT_DLG_H, 
    125          N_("Wrap mode"), 0, 0, 
    126          0, 0, NULL, NULL, NULL}, 
     126        {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 18, 
     127         OPT_DLG_H, N_("&Fake half tabs"), 0, 0, 0, 0, NULL, NULL, NULL}, 
    127128        /* 16 */ 
    128         {quick_radio, 5, OPT_DLG_W, OPT_DLG_H - 15, OPT_DLG_H, "", 3, 0, 0, 
    129          const_cast(char **, key_emu_str), "keyemu", NULL, NULL}, 
     129        {quick_radio, 5, OPT_DLG_W, OPT_DLG_H - 11, OPT_DLG_H, "", 3, 0, 0, 
     130         const_cast(char **, wrap_str), "wrapm", NULL, NULL}, 
    130131        /* 17 */ 
    131         {quick_label, 4, OPT_DLG_W, OPT_DLG_H - 16, OPT_DLG_H, 
     132        {quick_label, 4, OPT_DLG_W, OPT_DLG_H - 12, OPT_DLG_H, 
     133         N_("Wrap mode"), 0, 0, 0, 0, NULL, NULL, NULL}, 
     134        /* 18 */ 
     135        {quick_radio, 5, OPT_DLG_W, OPT_DLG_H - 17, OPT_DLG_H, "", 3, 0, 0, 
     136         const_cast(char **, key_emu_str), "keyemu", NULL, NULL}, 
     137        /* 19 */ 
     138        {quick_label, 4, OPT_DLG_W, OPT_DLG_H - 18, OPT_DLG_H, 
    132139         N_("Key emulation"), 0, 0, 0, 0, NULL, NULL, NULL}, 
    133140        NULL_QuickWidget 
    134141    }; 
    edit_options_dialog (void) 
    153160    quick_widgets[5].str_result = &q; 
    154161    quick_widgets[6].result = &tedit_persistent_selections; 
    155162    quick_widgets[7].result = &tedit_syntax_highlighting; 
    156     quick_widgets[8].result = &toption_save_position; 
    157     quick_widgets[9].result = &tedit_confirm_save; 
    158     quick_widgets[10].result = &toption_fill_tabs_with_spaces; 
    159     quick_widgets[11].result = &toption_return_does_auto_indent; 
    160     quick_widgets[12].result = &toption_backspace_through_tabs; 
    161     quick_widgets[13].result = &toption_fake_half_tabs; 
     163    quick_widgets[8].result = &tedit_visible_tabs; 
     164    quick_widgets[9].result = &tedit_visible_tws; 
     165    quick_widgets[10].result = &toption_save_position; 
     166    quick_widgets[11].result = &tedit_confirm_save; 
     167    quick_widgets[12].result = &toption_fill_tabs_with_spaces; 
     168    quick_widgets[13].result = &toption_return_does_auto_indent; 
     169    quick_widgets[14].result = &toption_backspace_through_tabs; 
     170    quick_widgets[15].result = &toption_fake_half_tabs; 
    162171 
    163172    if (option_auto_para_formatting) 
    164173        wrap_mode = 1; 
    edit_options_dialog (void) 
    167176    else 
    168177        wrap_mode = 0; 
    169178 
    170     quick_widgets[14].result = &wrap_mode; 
    171     quick_widgets[14].value = wrap_mode; 
     179    quick_widgets[16].result = &wrap_mode; 
     180    quick_widgets[16].value = wrap_mode; 
    172181 
    173     quick_widgets[16].result = &tedit_key_emulation; 
    174     quick_widgets[16].value = tedit_key_emulation; 
     182    quick_widgets[18].result = &tedit_key_emulation; 
     183    quick_widgets[18].value = tedit_key_emulation; 
    175184 
    176185    Quick_options.widgets = quick_widgets; 
    177186 
    edit_options_dialog (void) 
    193202 
    194203    option_persistent_selections = tedit_persistent_selections; 
    195204    option_syntax_highlighting = tedit_syntax_highlighting; 
     205    visible_tabs = tedit_visible_tabs; 
     206    visible_tws = tedit_visible_tws; 
    196207    edit_confirm_save = tedit_confirm_save; 
    197208    option_save_position = toption_save_position; 
    198209    option_fill_tabs_with_spaces = toption_fill_tabs_with_spaces; 
    edit_options_dialog (void) 
    219230 
    220231    /* Load or unload syntax rules if the option has changed */ 
    221232    if (option_syntax_highlighting != old_syntax_hl) 
    222         edit_load_syntax (wedit, NULL, option_syntax_type); 
     233        edit_load_syntax (wedit, NULL, option_syntax_type); 
    223234    /* Load usermap if it's needed */ 
    224235    edit_load_user_map (wedit); 
    225236}