]> git.neil.brown.name Git - edlib.git/commitdiff
lib-renderline: Fix length of split section in do_draw()
authorNeilBrown <neil@brown.name>
Mon, 14 Aug 2023 02:27:40 +0000 (12:27 +1000)
committerNeilBrown <neil@brown.name>
Tue, 15 Aug 2023 09:47:00 +0000 (19:47 +1000)
Need to subtract start from the end to get the length.

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

index 2bc45cd3dcf805f857f42cb93978d66f4364ba98..f701aad5229e9f4ff4997a279efb838752bf6d64 100644 (file)
@@ -10,7 +10,7 @@ the file.
 ### Triage
 
 
-- [ ] check formatting in x11 display.  Wrap causes problems 474/476 of
+- [X] check formatting in x11 display.  Wrap causes problems 474/476 of
       render-present.py and elsewhere
 - [ ] check notmuch formatting.  wrap-margin isn't right!
 - [X] email display: image positioning is wrong.  Maybe they don't get
index fd683774ff9ccfde0daf6df6e1b2936add1dfebc..913417c6e63893293f9f3d70967cf8a45fa59327 100644 (file)
@@ -534,8 +534,12 @@ static inline void do_draw(struct pane *p safe,
                if (split)
                        offset = -1;
        }
-       if (ri->split_list && split < ri->split_cnt)
-               len = ri->split_list[split];
+       if (ri->split_list) {
+               if (split < ri->split_cnt)
+                       len = ri->split_list[split];
+               if (split)
+                       len -= ri->split_list[split-1];
+       }
 
        if (str[0] == '\t')
                /* Tab need a list of spaces */