From: NeilBrown Date: Fri, 18 Aug 2023 22:56:44 +0000 (+1000) Subject: lib-renderline: another wrapping fix. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=8bddc2866eed3654eb128505cd339b2986796dbb;p=edlib.git lib-renderline: another wrapping fix. If the wrap item is the part that won't it, need need to be caseful that 'x' hasn't been adjusted for xdiff yet. Signed-off-by: NeilBrown --- diff --git a/lib-renderline.c b/lib-renderline.c index ef506a3e..436f7491 100644 --- a/lib-renderline.c +++ b/lib-renderline.c @@ -799,10 +799,15 @@ static int measure_line(struct pane *p safe, struct pane *focus safe, int offset wraprl2 = wraprl2->next) ; wrap_margin = wraprl2->wrap_x; - if (wraprl2->next) + if (wraprl2->next) { xd = wraprl2->next->x - wrap_margin; - else + if (wraprl2->next->start > ri->start) + xd += xdiff; + } else { xd = wraprl2->x - wrap_margin; + if (wraprl2->start > ri->start) + xd += xdiff; + } if (offset >= 0 && offset >= wraprl->start && offset <= wraprl2->start + wraprl2->len) { diff --git a/tests.d/00-basic b/tests.d/00-basic index 35ad0e3d..8f5d387a 100644 --- a/tests.d/00-basic +++ b/tests.d/00-basic @@ -503,9 +503,9 @@ Display 80,30 49DECBFB2A41E29F2A4E3D11414E63CD 1,6 Key ":C-X" Display 80,30 B704A177DA5EB1C12A89E4BD1A733A5A 1,6 Key "-3" -Display 80,30 A9F9BF76E449665B71854462652EA50F 5,11 +Display 80,30 1253E9C407D87A32FC4FE191F5A99670 5,11 Key ":C-X" -Display 80,30 DA07D5AA2EA00CCC8DDB1BB912CDDF25 5,11 +Display 80,30 EC3ADB646947764A80526E3335BEF4DB 5,11 Key "-1" Display 80,30 B239318A0DD9E1855A5A26A3F691A514 1,5 Key "-1"