Ticket #113: 16004-cedit-eol-mark.diff

File 16004-cedit-eol-mark.diff, 2.7 KB (added by slavazanko, 15 years ago)
  • mc-4.6.2-pre1

    Implement showing an EOL mark.
    
    Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
    
    ---
     edit/edit.c        |    4 ++--
     edit/edit.h        |    1 +
     edit/editdraw.c    |    3 ++-
     edit/editoptions.c |   12 ++++++++++++
     4 files changed, 17 insertions(+), 3 deletions(-)
    
    old new edit_execute_cmd (WEdit *edit, int comma 
    26522652        break; 
    26532653 
    26542654    case CK_Toggle_Syntax2: 
    2655         ++option_highlighting; 
    2656         option_highlighting %= 4; 
     2655        option_highlighting = (((option_highlighting & 0x3) + 1) % 4) | 
     2656                              (option_highlighting & ~0x3); 
    26572657        edit->force |= REDRAW_PAGE; 
    26582658        break; 
    26592659 
  • mc-4.6.2-pre1

    old new typedef enum { 
    310310enum { 
    311311        HL_WHITESPACE = 1 << 0, 
    312312        HL_TABS       = 1 << 1, 
     313        HL_EOL        = 1 << 2, 
    313314}; 
    314315 
    315316extern int option_save_mode; 
  • edit/editdraw.c

    old new edit_draw_this_line (WEdit *edit, long b 
    347347                switch (c) { 
    348348                case '\n': 
    349349                    col = end_col - edit->start_col + 1;        /* quit */ 
    350                     p->ch = ' '; 
     350                    p->ch = (option_highlighting & HL_EOL) ? 0xB6 : ' '; 
     351                    p->style |= MOD_WHITESPACE; 
    351352                    p++; 
    352353                    break; 
    353354                case '\t': 
  • edit/editoptions.c

    old new void edit_syntax_opt_dialog(void) 
    6868        int f_syntax_hl = option_syntax_highlighting; 
    6969        int f_tab_hl    = option_highlighting & HL_TABS; 
    7070        int f_ws_hl     = option_highlighting & HL_WHITESPACE; 
     71        int f_ws_eol    = option_highlighting & HL_EOL; 
    7172 
    7273        int old_syntax_hl = f_syntax_hl; 
    7374 
    void edit_syntax_opt_dialog(void) 
    9495                        .widget_type = quick_checkbox, 
    9596                        .relative_x  = 6, 
    9697                        .x_divisions = OPT_DLG_W, 
     98                        .relative_y  = 7, 
     99                        .y_divisions = OPT_DLG_H, 
     100                        .text        = N_("EOL highlighting"), 
     101                        .result      = &f_ws_eol, 
     102                }, 
     103                { 
     104                        .widget_type = quick_checkbox, 
     105                        .relative_x  = 6, 
     106                        .x_divisions = OPT_DLG_W, 
    97107                        .relative_y  = 6, 
    98108                        .y_divisions = OPT_DLG_H, 
    99109                        .text        = N_("Whitespace highlighting"), 
    void edit_syntax_opt_dialog(void) 
    142152                option_highlighting |= HL_TABS; 
    143153        if (f_ws_hl) 
    144154                option_highlighting |= HL_WHITESPACE; 
     155        if (f_ws_eol) 
     156                option_highlighting |= HL_EOL; 
    145157} 
    146158#undef OPT_DLG_H 
    147159#undef OPT_DLG_W