From: NeilBrown Date: Mon, 14 Aug 2023 02:27:40 +0000 (+1000) Subject: lib-renderline: Fix length of split section in do_draw() X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=a0d822bc3c05317e1ea9609b8be0d9a317722fc0;p=edlib.git lib-renderline: Fix length of split section in do_draw() Need to subtract start from the end to get the length. Signed-off-by: NeilBrown --- diff --git a/DOC/TODO.md b/DOC/TODO.md index 2bc45cd3..f701aad5 100644 --- a/DOC/TODO.md +++ b/DOC/TODO.md @@ -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 diff --git a/lib-renderline.c b/lib-renderline.c index fd683774..913417c6 100644 --- a/lib-renderline.c +++ b/lib-renderline.c @@ -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 */