From 39c3e17e5fa989a5db5825ceb9be54ba77c7b92d Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 3 May 2022 21:37:35 -0700 Subject: Line number cosmetic issue. When the FIFO isn't full, we output lines. In numbered mode, line numbers aren't printed, so things look funny. Let's print zeros. These will refresh to the actual values. --- pw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pw.c') diff --git a/pw.c b/pw.c index 1c883ec..5d5c5b9 100644 --- a/pw.c +++ b/pw.c @@ -324,7 +324,7 @@ static void drawline(const char *line, unsigned hpos, int columns, int lineno) { size_t len = dslen(line); - if (lineno > 0) + if (lineno >= 0) columns -= printf("%3d ", lineno); if ((size_t) hpos <= len) { @@ -931,7 +931,7 @@ int main(int argc, char **argv) snapshot[0] = resizebuf(snapshot[0], snaplines[0], snaplines[0] + 1); snapshot[0][snaplines[0]++] = dsref(line); clrline(stat); - drawline(line, hpos, columns, -1); + drawline(line, hpos, columns, (stat & stat_lino) ? 0: -1); drawstatus(hist, columns, stat, curcmd); } } -- cgit v1.2.3