From 26f2607095bcde26c5eaf9d7addac6c6eef8e921 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Fri, 6 Feb 2015 21:48:50 +0100 Subject: [PATCH] select links as words. Closes T2038 --- src/bin/termio.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/bin/termio.c b/src/bin/termio.c index 21d2f22e..75f7cceb 100644 --- a/src/bin/termio.c +++ b/src/bin/termio.c @@ -2674,6 +2674,17 @@ _sel_word(Termio *sd, int cx, int cy) sd->pty->selection.end.y = cy; x = cx; y = cy; + + if (sd->link.string && + (sd->link.x1 <= cx) && (cx <= sd->link.x2) && + (sd->link.y1 <= cy) && (cy <= sd->link.y2)) + { + sd->pty->selection.start.x = sd->link.x1; + sd->pty->selection.start.y = sd->link.y1; + sd->pty->selection.end.x = sd->link.x2; + sd->pty->selection.end.y = sd->link.y2; + goto end; + } cells = termpty_cellrow_get(sd->pty, y, &w); if (!cells) goto end; if (x >= w) x = w - 1;