aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-05-03 21:37:35 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-05-03 21:37:35 -0700
commit39c3e17e5fa989a5db5825ceb9be54ba77c7b92d (patch)
tree95822ece2e5d49172622fe0931b1a41745ef1aa3
parent0d7b3425f8eb4c7754d8a18c438af0541fa9ba91 (diff)
downloadpw-39c3e17e5fa989a5db5825ceb9be54ba77c7b92d.tar.gz
pw-39c3e17e5fa989a5db5825ceb9be54ba77c7b92d.tar.bz2
pw-39c3e17e5fa989a5db5825ceb9be54ba77c7b92d.zip
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.
-rw-r--r--pw.c4
1 files changed, 2 insertions, 2 deletions
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);
}
}