summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-09-07 17:51:09 -0400
committerJune McEnroe <june@causal.agency>2020-09-07 17:51:09 -0400
commit172d01a668fa5c5ca3410bf9dff37f64a366f620 (patch)
tree4db49c36a703124ff5bed3833739c390c8b2a591
parentHandle non-alignment tabs in line wrapping (diff)
downloadcatgirl-172d01a668fa5c5ca3410bf9dff37f64a366f620.tar.gz
catgirl-172d01a668fa5c5ca3410bf9dff37f64a366f620.zip
Let wrapped lines use the last column
-rw-r--r--buffer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/buffer.c b/buffer.c
index 7478211..3795a24 100644
--- a/buffer.c
+++ b/buffer.c
@@ -138,10 +138,10 @@ static int flow(struct Lines *hard, int cols, const struct Line *soft) {
 			width += wcwidth(wc);
 		}
 
+		if (tab && width < cols) align = width;
+		if (iswspace(wc) && !tab) wrap = str;
 		if (width <= cols) {
-			if (tab && width < cols) align = width;
-			if (iswspace(wc) && !tab) wrap = str;
-			if (*str == '-') wrap = &str[1];
+			if (wc == L'-') wrap = &str[n];
 			str += n;
 			continue;
 		}