From a0d822bc3c05317e1ea9609b8be0d9a317722fc0 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 14 Aug 2023 12:27:40 +1000 Subject: [PATCH] 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 --- DOC/TODO.md | 2 +- lib-renderline.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) 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 */ -- 2.39.5