diff --git a/src/bin/termiolink.c b/src/bin/termiolink.c index 58a7a6a1..d5a3fd5a 100644 --- a/src/bin/termiolink.c +++ b/src/bin/termiolink.c @@ -309,6 +309,8 @@ termio_link_find(const Evas_Object *obj, int cx, int cy, res = _txt_at(ty, &x1, &y1, txt, &txtlen); if ((res != 0) || (txtlen == 0)) goto end; + if (isspace(txt[0])) + goto end; res = ty_sb_add(&sb, txt, txtlen); if (res < 0) goto end; diff --git a/tests/link_detection.sh b/tests/link_detection.sh index b67d8822..d05834bc 100755 --- a/tests/link_detection.sh +++ b/tests/link_detection.sh @@ -20,7 +20,6 @@ printf 'Jolly Roger fluke me brig grapple furl tack rutters gally brigantine. S printf "Reef sails Gold Road dead men tell no tales aft gangway lad quarter draught case shot grapple. Stern lass jury mast yo-ho-ho maroon shrouds mizzen /usr/bin/terminology wench jolly boat Admiral of the Black. Maroon Chain Shot pirate wench pillage strike colors bowsprit bucko lee Davy Jones\' Locker. \r\n" - ## # URL (https://terminolo.gy/) ## @@ -67,10 +66,8 @@ printf '\033}tlu;65;1;5;2;https://terminolo.gy/\0' # mouse move printf '\033}tm;45;45\0' -# TODO: buggy -### no url detection on space after url -##printf '\033}tln\0' - +# no url detection on space after url +printf '\033}tln\0' ## # Not a link (league.) @@ -113,16 +110,14 @@ printf '\033}tm;410;85\0' printf '\033}tln\0' - ## # Email (foo.bar@qux.com) ## # mouse move printf '\033}tm;485;130\0' -# TODO: buggy -### no email detection on ' ' before email -##printf '\033}tln\0' +# no email detection on ' ' before email +printf '\033}tln\0' # mouse move printf '\033}tm;495;133\0' @@ -145,11 +140,9 @@ printf '\033}tm;10;140\0' printf '\033}tle;70;8;4;9;foo.bar@qux.com\0' # mouse move -printf '\033}tm;40;140\0' -# TODO: buggy -### no email detection on ' ' after email -##printf '\033}tle;70;8;4;9;foo.bar@qux.com\0' - +printf '\033}tm;45;140\0' +# no email detection on ' ' after email +printf '\033}tln\0' ## @@ -183,9 +176,8 @@ printf '\033}tlp;69;13;5;14;%s/bin/terminology\0' "$HOME" # mouse move printf '\033}tm;48;215\0' -# TODO: buggy -### no file detection on ' ' after path -##printf '\033}tln\0' +# no file detection on ' ' after path +printf '\033}tln\0' @@ -219,9 +211,8 @@ printf '\033}tm;40;295\0' printf '\033}tlp;67;18;6;19;/usr/bin/terminology\0' # mouse move -printf '\033}tm;58;295\0' -# TODO: buggy -### no file detection on ' ' after path -##printf '\033}tln\0' +printf '\033}tm;55;295\0' +# no file detection on ' ' after path +printf '\033}tln\0' diff --git a/tests/tests.results b/tests/tests.results index 40b27847..3876ee13 100644 --- a/tests/tests.results +++ b/tests/tests.results @@ -119,4 +119,4 @@ mouse_reporting_mode_mouse_move_pressed_ext_urxvt.sh 59f3e59b60b3a43260de6a80135 mouse_reporting_mode_all_ext_urxvt.sh a11bbc8ebea42d06cc3ad823b52c09b3 shift_in_out.sh 3896bcc6887998bbc41b43840a6b2e33 osc-11-query.sh b762d503e40641ff896dac46391ad7a8 -link_detection.sh cc2f2a5ae9ee70bec702cb5656339a54 +link_detection.sh bbe87a849586e8b922f26ad5d88146dc