vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit cbae4044a13d1754659c12d9c80c8fd0b17698ba parent ee0c8899fbaac83dd8e3c94ef090414de1607256 Author: Marc André Tanner <mat@brain-dump.org> Date: Wed, 29 Apr 2020 07:39:39 +0200 ui: fix line number drawing Fix #830 Diffstat:
| M | ui-terminal.c | | | 4 | ++-- |
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ui-terminal.c b/ui-terminal.c @@ -249,13 +249,13 @@ static void ui_window_draw(UiWin *w) { Selection *sel = view_selections_primary_get(view); const Line *cursor_line = view_cursors_line_get(sel); size_t cursor_lineno = cursor_line->lineno; - char buf[(sizeof(size_t) * CHAR_BIT + 2) / 3 + 1]; + char buf[(sizeof(size_t) * CHAR_BIT + 2) / 3 + 1 + 1]; int x = win->x, y = win->y; int view_width = view_width_get(view); Cell *cells = ui->cells + y * ui->width; if (x + sidebar_width + view_width > ui->width) view_width = ui->width - x - sidebar_width; - for (const Line *l = line; l; l = l->next) { + for (const Line *l = line; l; l = l->next, y++) { if (sidebar) { if (!l->lineno || !l->len || l->lineno == prev_lineno) { memset(buf, ' ', sizeof(buf));