From 37d50f2acacd6c6c3842f50c4c7d457fc02226db Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 6 May 2022 19:26:12 -0700 Subject: 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. --- pw.c | 12 ++++++------ 1 file 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) { -- cgit v1.2.3