Ticket #3482: mc-fix_tabs_with_space.patch
File mc-fix_tabs_with_space.patch, 2.6 KB (added by Mihail Zenkov, 10 years ago) |
---|
-
src/editor/edit-impl.h
old new 61 61 62 62 /* Tabs spaces: (sofar only HALF_TAB_SIZE is used: */ 63 63 #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) 65 65 66 66 /* max count stack files */ 67 67 #define MAX_HISTORY_MOVETO 50 -
src/editor/edit.c
old new 1628 1628 1629 1629 edit_cursor_move (edit, cur_bol - edit->buffer.curs1); 1630 1630 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; 1635 1632 1636 1633 next_char = edit_buffer_get_current_byte (&edit->buffer); 1637 1634 if (next_char == '\t') … … 2952 2949 else 2953 2950 { 2954 2951 edit->over_col = 0; 2955 if ( option_fake_half_tabs &&is_in_indent (&edit->buffer))2952 if (is_in_indent (&edit->buffer)) 2956 2953 { 2957 2954 long fake_half_tabs; 2958 2955 … … 3445 3442 while (edit_buffer_get_previous_byte (&edit->buffer) != '\n' && edit->buffer.curs1 > 0) 3446 3443 edit_backspace (edit, TRUE); 3447 3444 } 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)) 3450 3446 { 3451 3447 int i; 3452 3448 … … 3465 3461 if (option_cursor_beyond_eol && edit->over_col > 0) 3466 3462 edit_insert_over (edit); 3467 3463 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)) 3469 3465 { 3470 3466 int i; 3471 3467 … … 3531 3527 edit->column_highlight = 1; 3532 3528 case CK_Left: 3533 3529 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)) 3535 3531 { 3536 3532 if (option_cursor_beyond_eol && edit->over_col > 0) 3537 3533 edit->over_col--; … … 3546 3542 edit->column_highlight = 1; 3547 3543 case CK_Right: 3548 3544 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)) 3550 3546 { 3551 3547 edit_cursor_move (edit, HALF_TAB_SIZE); 3552 3548 edit->force &= (0xFFF - REDRAW_CHAR_ONLY);