Ticket #3482: mc-fix_tabs_with_space.patch

File mc-fix_tabs_with_space.patch, 2.6 KB (added by Mihail Zenkov, 9 years ago)
  • src/editor/edit-impl.h

    old new  
    6161 
    6262/* Tabs spaces: (sofar only HALF_TAB_SIZE is used: */ 
    6363#define TAB_SIZE      option_tab_spacing 
    64 #define HALF_TAB_SIZE ((int) option_tab_spacing / 2) 
     64#define HALF_TAB_SIZE (option_fake_half_tabs ? ((int) option_tab_spacing / 2) : option_tab_spacing) 
    6565 
    6666/* max count stack files */ 
    6767#define MAX_HISTORY_MOVETO     50 
  • src/editor/edit.c

    old new  
    16281628 
    16291629        edit_cursor_move (edit, cur_bol - edit->buffer.curs1); 
    16301630 
    1631         if (option_fake_half_tabs) 
    1632             del_tab_width = HALF_TAB_SIZE; 
    1633         else 
    1634             del_tab_width = option_tab_spacing; 
     1631        del_tab_width = HALF_TAB_SIZE; 
    16351632 
    16361633        next_char = edit_buffer_get_current_byte (&edit->buffer); 
    16371634        if (next_char == '\t') 
     
    29522949    else 
    29532950    { 
    29542951        edit->over_col = 0; 
    2955         if (option_fake_half_tabs && is_in_indent (&edit->buffer)) 
     2952        if (is_in_indent (&edit->buffer)) 
    29562953        { 
    29572954            long fake_half_tabs; 
    29582955 
     
    34453442            while (edit_buffer_get_previous_byte (&edit->buffer) != '\n' && edit->buffer.curs1 > 0) 
    34463443                edit_backspace (edit, TRUE); 
    34473444        } 
    3448         else if (option_fake_half_tabs && is_in_indent (&edit->buffer) 
    3449                  && right_of_four_spaces (edit)) 
     3445        else if (is_in_indent (&edit->buffer) && right_of_four_spaces (edit)) 
    34503446        { 
    34513447            int i; 
    34523448 
     
    34653461            if (option_cursor_beyond_eol && edit->over_col > 0) 
    34663462                edit_insert_over (edit); 
    34673463 
    3468             if (option_fake_half_tabs && is_in_indent (&edit->buffer) && left_of_four_spaces (edit)) 
     3464            if (is_in_indent (&edit->buffer) && left_of_four_spaces (edit)) 
    34693465            { 
    34703466                int i; 
    34713467 
     
    35313527        edit->column_highlight = 1; 
    35323528    case CK_Left: 
    35333529    case CK_MarkLeft: 
    3534         if (option_fake_half_tabs && is_in_indent (&edit->buffer) && right_of_four_spaces (edit)) 
     3530        if (is_in_indent (&edit->buffer) && right_of_four_spaces (edit)) 
    35353531        { 
    35363532            if (option_cursor_beyond_eol && edit->over_col > 0) 
    35373533                edit->over_col--; 
     
    35463542        edit->column_highlight = 1; 
    35473543    case CK_Right: 
    35483544    case CK_MarkRight: 
    3549         if (option_fake_half_tabs && is_in_indent (&edit->buffer) && left_of_four_spaces (edit)) 
     3545        if (is_in_indent (&edit->buffer) && left_of_four_spaces (edit)) 
    35503546        { 
    35513547            edit_cursor_move (edit, HALF_TAB_SIZE); 
    35523548            edit->force &= (0xFFF - REDRAW_CHAR_ONLY);