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; |
69 | 69 | |
70 | 70 | extern int visible_tabs; |
71 | 71 | extern int visible_tws; |
| 72 | extern int visible_eol; |
72 | 73 | |
73 | 74 | extern int simple_statusbar; |
74 | 75 | extern int option_check_nl_at_eof; |
diff --git a/src/editor/editdraw.c b/src/editor/editdraw.c
index 7fbb294..fb23f4b 100644
a
|
b
|
|
57 | 57 | /* Toggles statusbar draw style */ |
58 | 58 | int simple_statusbar = 0; |
59 | 59 | |
60 | | int visible_tabs = 1, visible_tws = 1; |
| 60 | int visible_tabs = 1, visible_tws = 1, visible_eol; |
61 | 61 | |
62 | 62 | /*** file scope macro definitions ****************************************************************/ |
63 | 63 | |
… |
… |
edit_draw_this_line (WEdit * edit, long b, long row, long start_col, long end_co |
419 | 419 | { |
420 | 420 | case '\n': |
421 | 421 | 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 | } |
422 | 428 | break; |
423 | 429 | case '\t': |
424 | 430 | i = TAB_SIZE - ((int) col % TAB_SIZE); |
diff --git a/src/editor/editoptions.c b/src/editor/editoptions.c
index ece015c..482e74b 100644
a
|
b
|
edit_options_dialog (WEdit * edit) |
90 | 90 | /* 3 */ QUICK_INPUT (OPT_DLG_W / 2 + 25, OPT_DLG_W, 12, OPT_DLG_H, |
91 | 91 | wrap_length, OPT_DLG_W / 2 - 4 - 24, 0, "edit-word-wrap", &p), |
92 | 92 | /* 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, |
95 | 93 | 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, |
97 | 95 | 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, |
99 | 97 | 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), |
100 | 100 | /* 8 */ QUICK_CHECKBOX (OPT_DLG_W / 2 + 1, OPT_DLG_W, 7, OPT_DLG_H, |
101 | 101 | N_("Visible tabs"), &visible_tabs), |
102 | 102 | /* 9 */ QUICK_CHECKBOX (OPT_DLG_W / 2 + 1, OPT_DLG_W, 6, OPT_DLG_H, |
… |
… |
edit_options_dialog (WEdit * edit) |
107 | 107 | N_("Confir&m before saving"), &edit_confirm_save), |
108 | 108 | /* 12 */ QUICK_CHECKBOX (OPT_DLG_W / 2 + 1, OPT_DLG_W, 3, OPT_DLG_H, |
109 | 109 | 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, |
112 | 112 | 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, |
114 | 116 | 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, |
116 | 118 | 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, |
118 | 120 | 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")), |
121 | 123 | QUICK_END |
122 | 124 | }; |
123 | 125 | |
diff --git a/src/setup.c b/src/setup.c
index 2d7dad7..bc91e93 100644
a
|
b
|
static const struct |
304 | 304 | { "editor_cursor_beyond_eol", &option_cursor_beyond_eol }, |
305 | 305 | { "editor_visible_tabs", &visible_tabs }, |
306 | 306 | { "editor_visible_spaces", &visible_tws }, |
| 307 | { "editor_visible_eol", &visible_eol }, |
307 | 308 | { "editor_line_state", &option_line_state }, |
308 | 309 | { "editor_simple_statusbar", &simple_statusbar }, |
309 | 310 | { "editor_check_new_line", &option_check_nl_at_eof }, |