aboutsummaryrefslogtreecommitdiff
path: root/ui-curses.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-07-02 11:06:18 +0200
committerMarc André Tanner <mat@brain-dump.org>2015-07-03 09:59:37 +0200
commit87c7258ccc683965d2b6a5190f1e98d74c8d25d3 (patch)
tree7d8dfbe8efe4f23f9d6848c19be9e55e2bbb58b3 /ui-curses.c
parent860ad58af0e1c39d5ffda0474ed3c58aaa1ecca5 (diff)
downloadvis-87c7258ccc683965d2b6a5190f1e98d74c8d25d3.tar.gz
vis-87c7258ccc683965d2b6a5190f1e98d74c8d25d3.tar.xz
Add :show command to display special symbols for whitespaces
Enable/disable by setting to 0/1 respectively: :set show spaces=0 tabs=0 newlines=1
Diffstat (limited to 'ui-curses.c')
-rw-r--r--ui-curses.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ui-curses.c b/ui-curses.c
index a999aef..5dfb299 100644
--- a/ui-curses.c
+++ b/ui-curses.c
@@ -213,7 +213,7 @@ static void ui_window_draw_sidebar(UiCursesWin *win, const Line *line) {
size_t cursor_lineno = view_cursor_getpos(win->view).line;
werase(win->winside);
for (const Line *l = line; l; l = l->next, i++) {
- if (l->lineno != prev_lineno) {
+ if (l->lineno && l->lineno != prev_lineno) {
if (win->options & UI_OPTION_LINE_NUMBERS_ABSOLUTE) {
mvwprintw(win->winside, i, 0, "%*u", sidebar_width-1, l->lineno);
} else if (win->options & UI_OPTION_LINE_NUMBERS_RELATIVE) {
@@ -376,6 +376,8 @@ static void ui_window_draw_text(UiWin *w, const Line *line) {
wattrset(win->win, l->cells[x].attr);
waddstr(win->win, l->cells[x].data);
}
+ if (l->width != win->width - win->sidebar_width)
+ waddstr(win->win, "\n");
}
wclrtoeol(win->win);
}