]> git.neil.brown.name Git - edlib.git/commitdiff
lib-renderline: another wrapping fix.
authorNeilBrown <neil@brown.name>
Fri, 18 Aug 2023 22:56:44 +0000 (08:56 +1000)
committerNeilBrown <neil@brown.name>
Sun, 20 Aug 2023 22:45:33 +0000 (08:45 +1000)
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 <neil@brown.name>
lib-renderline.c
tests.d/00-basic

index ef506a3e633860b3abff98ddefd68f37fb7c929b..436f7491ca41b4ef9d1f5d8f04cc22a3f90d81a6 100644 (file)
@@ -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) {
index 35ad0e3d47bc14228d5b1770922ae3845efe084a..8f5d387a8841b1b8837ac9c6d7e16ad43c558529 100644 (file)
@@ -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"