From a672f7d553ac17d5aaef8dc667dee31d5815677d Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Tue, 19 Mar 2019 19:14:17 +0000 Subject: Add URL hover highlighting This changes the cursor whenever it moves to a cell which contains part of a URL. When a URL is hovered over, all characters that are recognized as part of the URL will be underlined and the mouse cursor shape will be changed. After the cursor leaves the URL, the previous hover state is restored. This also changes the behavior when clicking an illegal character right in front of a URL. Previously this would still launch the URL, but strip the illegal character. Now these clicks are ignored to make sure there's no mismatch between underline and legal URL click positions --- src/grid/tests.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/grid/tests.rs') diff --git a/src/grid/tests.rs b/src/grid/tests.rs index 82edda69..33d772a2 100644 --- a/src/grid/tests.rs +++ b/src/grid/tests.rs @@ -112,8 +112,8 @@ fn test_iter() { assert_eq!(None, iter.prev()); assert_eq!(Some(&1), iter.next()); - assert_eq!(Column(1), iter.cur.col); - assert_eq!(4, iter.cur.line); + assert_eq!(Column(1), iter.cur().col); + assert_eq!(4, iter.cur().line); assert_eq!(Some(&2), iter.next()); assert_eq!(Some(&3), iter.next()); @@ -121,12 +121,12 @@ fn test_iter() { // test linewrapping assert_eq!(Some(&5), iter.next()); - assert_eq!(Column(0), iter.cur.col); - assert_eq!(3, iter.cur.line); + assert_eq!(Column(0), iter.cur().col); + assert_eq!(3, iter.cur().line); assert_eq!(Some(&4), iter.prev()); - assert_eq!(Column(4), iter.cur.col); - assert_eq!(4, iter.cur.line); + assert_eq!(Column(4), iter.cur().col); + assert_eq!(4, iter.cur().line); // test that iter ends at end of grid -- cgit v1.2.3-54-g00ecf