Ticket #2525: 2525.diff

File 2525.diff, 5.7 KB (added by jengelh, 13 years ago)
  • src/editor/edit.h

    parent 78019b896ba0e59ba886ecf500747cbe77dbc7cb (4.7.5-189-g78019b8)
    commit afd64cbbcbc6b94970587ccaefbe4f85beb7f58d
    Author: Jan Engelhardt <jengelh@medozas.de>
    Date:   Thu Mar 31 00:35:16 2011 +0200
    
    editor: add option to show EOL
    
    Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
    ---
     src/editor/edit.h        |    1 +
     src/editor/editdraw.c    |    8 +++++++-
     src/editor/editoptions.c |   24 +++++++++++++-----------
     src/setup.c              |    1 +
     4 files changed, 22 insertions(+), 12 deletions(-)
    
    diff --git a/src/editor/edit.h b/src/editor/edit.h
    index d6b8344..bf539a3 100644
    a b extern int edit_confirm_save; 
    6969 
    7070extern int visible_tabs; 
    7171extern int visible_tws; 
     72extern int visible_eol; 
    7273 
    7374extern int simple_statusbar; 
    7475extern int option_check_nl_at_eof; 
  • src/editor/editdraw.c

    diff --git a/src/editor/editdraw.c b/src/editor/editdraw.c
    index 7fbb294..fb23f4b 100644
    a b  
    5757/* Toggles statusbar draw style */ 
    5858int simple_statusbar = 0; 
    5959 
    60 int visible_tabs = 1, visible_tws = 1; 
     60int visible_tabs = 1, visible_tws = 1, visible_eol; 
    6161 
    6262/*** file scope macro definitions ****************************************************************/ 
    6363 
    edit_draw_this_line (WEdit * edit, long b, long row, long start_col, long end_co 
    419419                { 
    420420                case '\n': 
    421421                    col = (end_col + utf8lag) - edit->start_col + 1;    /* quit */ 
     422                    if (tty_use_colors() && visible_eol) { 
     423                        p->ch = 0xB6; 
     424                        p->style |= MOD_WHITESPACE; 
     425                        ++p; 
     426                        ++col; 
     427                    } 
    422428                    break; 
    423429                case '\t': 
    424430                    i = TAB_SIZE - ((int) col % TAB_SIZE); 
  • src/editor/editoptions.c

    diff --git a/src/editor/editoptions.c b/src/editor/editoptions.c
    index ece015c..482e74b 100644
    a b edit_options_dialog (WEdit * edit) 
    9090        /*  3 */ QUICK_INPUT (OPT_DLG_W / 2 + 25, OPT_DLG_W, 12, OPT_DLG_H, 
    9191                              wrap_length, OPT_DLG_W / 2 - 4 - 24, 0, "edit-word-wrap", &p), 
    9292        /*  4 */ QUICK_CHECKBOX (OPT_DLG_W / 2 + 1, OPT_DLG_W, 11, OPT_DLG_H, 
    93                                  N_("&Group undo"), &option_group_undo), 
    94         /*  5 */ QUICK_CHECKBOX (OPT_DLG_W / 2 + 1, OPT_DLG_W, 10, OPT_DLG_H, 
    9593                                 N_("Cursor beyond end of line"), &option_cursor_beyond_eol), 
    96         /*  6 */ QUICK_CHECKBOX (OPT_DLG_W / 2 + 1, OPT_DLG_W, 9, OPT_DLG_H, 
     94        /*  5 */ QUICK_CHECKBOX (OPT_DLG_W / 2 + 1, OPT_DLG_W, 10, OPT_DLG_H, 
    9795                                 N_("Pers&istent selection"), &option_persistent_selections), 
    98         /*  7 */ QUICK_CHECKBOX (OPT_DLG_W / 2 + 1, OPT_DLG_W, 8, OPT_DLG_H, 
     96        /*  6 */ QUICK_CHECKBOX (OPT_DLG_W / 2 + 1, OPT_DLG_W, 9, OPT_DLG_H, 
    9997                                 N_("Synta&x highlighting"), &option_syntax_highlighting), 
     98        /*  7 */ QUICK_CHECKBOX (OPT_DLG_W / 2 + 1, OPT_DLG_W, 8, OPT_DLG_H, 
     99                                 N_("Visible EOL"), &visible_eol), 
    100100        /*  8 */ QUICK_CHECKBOX (OPT_DLG_W / 2 + 1, OPT_DLG_W, 7, OPT_DLG_H, 
    101101                                 N_("Visible tabs"), &visible_tabs), 
    102102        /*  9 */ QUICK_CHECKBOX (OPT_DLG_W / 2 + 1, OPT_DLG_W, 6, OPT_DLG_H, 
    edit_options_dialog (WEdit * edit) 
    107107                                 N_("Confir&m before saving"), &edit_confirm_save), 
    108108        /* 12 */ QUICK_CHECKBOX (OPT_DLG_W / 2 + 1, OPT_DLG_W, 3, OPT_DLG_H, 
    109109                                 N_("&Return does autoindent"), &option_return_does_auto_indent), 
    110         /* 13 */ QUICK_LABEL (3, OPT_DLG_W, 11, OPT_DLG_H, N_("Tab spacing:")), 
    111         /* 14 */ QUICK_INPUT (3 + 24, OPT_DLG_W, 11, OPT_DLG_H, 
     110        /* 13 */ QUICK_LABEL (3, OPT_DLG_W, 12, OPT_DLG_H, N_("Tab spacing:")), 
     111        /* 14 */ QUICK_INPUT (3 + 24, OPT_DLG_W, 12, OPT_DLG_H, 
    112112                              tab_spacing, OPT_DLG_W / 2 - 4 - 24, 0, "edit-tab-spacing", &q), 
    113         /* 15 */ QUICK_CHECKBOX (3, OPT_DLG_W, 10, OPT_DLG_H, 
     113        /* 15 */ QUICK_CHECKBOX (3, OPT_DLG_W, 11, OPT_DLG_H, 
     114                                 N_("&Group undo"), &option_group_undo), 
     115        /* 16 */ QUICK_CHECKBOX (3, OPT_DLG_W, 10, OPT_DLG_H, 
    114116                                 N_("Fill tabs with &spaces"), &option_fill_tabs_with_spaces), 
    115         /* 16 */ QUICK_CHECKBOX (3, OPT_DLG_W, 9, OPT_DLG_H, 
     117        /* 17 */ QUICK_CHECKBOX (3, OPT_DLG_W, 9, OPT_DLG_H, 
    116118                                 N_("&Backspace through tabs"), &option_backspace_through_tabs), 
    117         /* 17 */ QUICK_CHECKBOX (3, OPT_DLG_W, 8, OPT_DLG_H, 
     119        /* 18 */ QUICK_CHECKBOX (3, OPT_DLG_W, 8, OPT_DLG_H, 
    118120                                 N_("&Fake half tabs"), &option_fake_half_tabs), 
    119         /* 18 */ QUICK_RADIO (4, OPT_DLG_W, 4, OPT_DLG_H, 3, wrap_str, &wrap_mode), 
    120         /* 19 */ QUICK_LABEL (3, OPT_DLG_W, 3, OPT_DLG_H, N_("Wrap mode")), 
     121        /* 19 */ QUICK_RADIO (4, OPT_DLG_W, 4, OPT_DLG_H, 3, wrap_str, &wrap_mode), 
     122        /* 20 */ QUICK_LABEL (3, OPT_DLG_W, 3, OPT_DLG_H, N_("Wrap mode")), 
    121123        QUICK_END 
    122124    }; 
    123125 
  • src/setup.c

    diff --git a/src/setup.c b/src/setup.c
    index 2d7dad7..bc91e93 100644
    a b static const struct 
    304304    { "editor_cursor_beyond_eol", &option_cursor_beyond_eol }, 
    305305    { "editor_visible_tabs", &visible_tabs }, 
    306306    { "editor_visible_spaces", &visible_tws }, 
     307    { "editor_visible_eol", &visible_eol }, 
    307308    { "editor_line_state", &option_line_state }, 
    308309    { "editor_simple_statusbar", &simple_statusbar }, 
    309310    { "editor_check_new_line", &option_check_nl_at_eof },