]> git.neil.brown.name Git - edlib.git/commitdiff
lib-renderline: fix problems with finding position of 'click' location.
authorNeilBrown <neil@brown.name>
Fri, 25 Aug 2023 01:38:28 +0000 (11:38 +1000)
committerNeilBrown <neil@brown.name>
Fri, 25 Aug 2023 05:35:37 +0000 (15:35 +1000)
This broken menus and links etc.  So add a test for menus in the
spelling test.

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

index 77edd7185e092eafc14915a3061515d3b70d96af..f051ba3a0dff193bbb60883f2e6addfd5e5bb21d 100644 (file)
@@ -9,7 +9,7 @@ the file.
 
 ### Triage
 
-- [ ] clicking on link is BROKEN
+- [X] clicking on link is BROKEN
 - [X] tabs can wrap around a newline - with part of tab at end of one
       line and part at start of the next.  Do I want that?  do_measure()
       decides. YES.
index 16dc0fcae5f2d7a351e7328dcd3196238bb4908c..5cbaa2a26b11227ac2d4ca3a83101af46652ad9e 100644 (file)
@@ -876,6 +876,7 @@ static int find_xy(struct pane *p safe, struct pane *focus safe,
                if (r->y <= y && r->x <= x) {
                        ri = r;
                        start = r->start;
+                       splitpos = 0;
                }
                for (split = 0; split < r->split_cnt; split++) {
                        if (r->y + (split + 1) * rd->line_height <= y &&
@@ -893,7 +894,7 @@ static int find_xy(struct pane *p safe, struct pane *focus safe,
                return start;
        cr = do_measure(p, ri, splitpos, -1, x - ri->x);
        if ((splitpos ? ri->wrap_x : ri->x ) + cr.x > x &&
-           ri->y + rd->line_height * splitpos > y &&
+           ri->y + rd->line_height * (1 + splitpos) > y &&
            xyattr)
                *xyattr = ri->attr;
        if (cr.s)
index ae414e32cf01f649178eb9c518127fcdbf055475..701e7ea2f589b584f5e0ea7ebd4a2d0af27b4d40 100644 (file)
@@ -222,8 +222,18 @@ Key ":C-X"
 Display 80,30 9599A4BF3962C00266BB8CF8D9AB3088 59,24
 Key ":C-S"
 Display 80,30 15D263B1D5B3FDF5F97D3428BAC8D27A 59,24
+Mouse ":Press-3" 26,19
+Display 80,30 6F5B8256777D5528183E96E329DEF02A 26,19
+Mouse ":Release-3" 28,22
+Display 80,30 27E164C7FF1F619A0449FFCBCD256DBB 59,24
+Mouse ":Press-3" 2,21
+Display 80,30 C863D1562DFABCF048E1488BC4179421 2,21
+Mouse ":Release-3" 5,22
+Display 80,30 27E164C7FF1F619A0449FFCBCD256DBB 59,24
+Display 80,30 7E7D27ABFCF26E6F9024BE8A73EE9EE9 59,24
 Key ":C-X"
-Display 80,30 4EEC8A848EC8816669FCC7D1F8E9717F 59,24
+Display 80,30 120A6A63790E9F0E123CFEC24BDBB033 59,24
 Key ":C-C"
-Display 80,30 6DC926582CA3B121E4CCEEAD1963B806 59,24
-Close 591
+Display 80,30 43E0643A1430614E6E43F15DE5008897 21,8
+Key "-q"
+Close 680