aboutsummaryrefslogtreecommitdiffstats
path: root/pw.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-05-06 19:26:12 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-05-06 19:26:12 -0700
commit37d50f2acacd6c6c3842f50c4c7d457fc02226db (patch)
tree2808ac47c402328c95ee23f6fefac2797c894498 /pw.c
parent52c28447cd06bb431837fb289d78280c1957dd47 (diff)
downloadpw-37d50f2acacd6c6c3842f50c4c7d457fc02226db.tar.gz
pw-37d50f2acacd6c6c3842f50c4c7d457fc02226db.tar.bz2
pw-37d50f2acacd6c6c3842f50c4c7d457fc02226db.zip
Left and right separator indistinguishable when alone.
Finally, this is the "right" UI. If either ] or > is used by itself, it looks exactly the same. The middle pane created by ] simulates the left pane exactly. The end markers on the right edge of the middle pane are intelligently omitted, similarly to the right edge of the left pane. Very pleased.
Diffstat (limited to 'pw.c')
-rw-r--r--pw.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/pw.c b/pw.c
index f7e70ef..1b994bf 100644
--- a/pw.c
+++ b/pw.c
@@ -421,20 +421,20 @@ static void drawline(pwstate *pw, const char *line, int lineno)
putchar(*ptr++);
endmark = 1;
}
- for (; i < width; i++)
- putchar(' ');
- columns -= vsplit2;
+ if (len > vsplit2 + pw->hpos) {
+ for (; i < width; i++)
+ putchar(' ');
- if (len >= vsplit2) {
+ columns -= vsplit2;
line += vsplit2;
len -= vsplit2;
+ endmark = 1;
} else {
line += len;
len = 0;
+ endmark = (i == width);
}
-
- endmark = 1;
}
if (pw->hpos + 1 <= len) {