]> git.neil.brown.name Git - edlib.git/commitdiff
lib-renderline; fix double-cursors in display-x11
authorNeilBrown <neil@brown.name>
Sun, 20 Aug 2023 01:18:44 +0000 (11:18 +1000)
committerNeilBrown <neil@brown.name>
Sun, 20 Aug 2023 22:47:11 +0000 (08:47 +1000)
When a line wraps, display-x11 is showing cursor at end of one line and
start of next.  Fix that.

Signed-off-by: NeilBrown <neil@brown.name>
lib-renderline.c

index fc93a4413f689e72fade1a41347ed6b5889ae824..02543f05669e26977b8a3cf1a467755066d66082 100644 (file)
@@ -452,6 +452,8 @@ static inline void do_draw(struct pane *p safe,
        tmp = str[len];
        str[len] = 0;
 
+       if (offset >= len)
+               offset = -1;
        home_call(focus, "Draw:text", p, offset, NULL, str,
                           rd->scale, NULL, ri->attr, x, y);
        str[len] = tmp;