From a74679dd9594da4794bc0026715869affbfddd8f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 11 Nov 2020 14:00:00 +0530 Subject: [PATCH] Fix last character of URL not being detected if it is the only character on a new line Fixes #3088 --- docs/changelog.rst | 3 +++ kitty/mouse.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index ca6611b25..c31a0b931 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -41,6 +41,9 @@ To update |kitty|, :doc:`follow the instructions `. - Fix the send_text action not working in URL handlers (:iss:`3081`) +- Fix last character of URL not being detected if it is the only character on a + new line (:iss:`3088`) + 0.19.1 [2020-10-06] ------------------- diff --git a/kitty/mouse.c b/kitty/mouse.c index 9241ed5d6..e5a69c073 100644 --- a/kitty/mouse.c +++ b/kitty/mouse.c @@ -275,7 +275,7 @@ extend_url(Screen *screen, Line *line, index_type *x, index_type *y, char_type s // we deliberately allow non-continued lines as some programs, like // mutt split URLs with newlines at line boundaries index_type new_x = line_url_end_at(line, 0, false, sentinel, next_line_starts_with_url_chars); - if (!new_x) break; + if (!new_x && !line_startswith_url_chars(line)) break; *y += 1; *x = new_x; } }