From c81a8216dcde4006ce1684b23de6ee8f6f7fb500 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 13 Dec 2017 12:18:35 +0530 Subject: [PATCH] Limit the max number of lines to extend URLs over --- kitty/mouse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kitty/mouse.c b/kitty/mouse.c index 2add8c26b..1b64df475 100644 --- a/kitty/mouse.c +++ b/kitty/mouse.c @@ -144,7 +144,8 @@ drag_scroll(Window *w, OSWindow *frame) { static inline void extend_url(Screen *screen, Line *line, index_type *x, index_type *y) { - while(true) { + unsigned int count = 0; + while(count++ < 10) { if (*x != line->xnum - 1) break; line = screen_visual_line(screen, *y + 1); if (!line) break; // we deliberately allow non-continued lines as some programs, like mutt split URLs with newlines at line boundaries