summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWormHeamer2026-01-02 03:31:21 -0500
committerWormHeamer2026-01-02 03:31:21 -0500
commit228e08259b7c2bb666c2dc0fdd09d9a82a105eb9 (patch)
treecae157afa414273738639370e4a41669818a714c
parentedfd74e9688eaaf75dac601961c1d4164bf022c9 (diff)
don't highlight trailing whitespace in front of the cursor
-rw-r--r--main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main.c b/main.c
index 1576c65..4e31e6f 100644
--- a/main.c
+++ b/main.c
@@ -565,7 +565,8 @@ void draw_buf(EditBuf *eb) {
x = lmarg;
y++;
} else if (c == '\n' || c == '\t' || c == ' ') {
- VuiAttr a = txt_chr(start) == '\n' ? trailsp : txt;
+ int trail = txt_chr(start) == '\n' && !(l.p == start.p && l.i == start.i);
+ VuiAttr a = trail ? trailsp : txt;
if (c == '\t') {
u32 n = 1 + (-(x+1) & 7);
while (n--) vui_chra(x++, y, ' ', a);