The URL http://ab.de is a valid URL, which is clickable on every character except the colon and the first slash. Looking at the code, it seems, that find_colon_slash() doesn't quite do what you may have thought it does or does something different than what it was supposed to do. When hovering over the colon, the URL is short enough so that the search starts outside (to the right of) the URL and if (!is_url_char(ch)) return false; returns immediately because the character outside the URL will not be a valid URL character. The code seems a bit too complicated. May I try to rewrite it to search from the position of the mouse cursor outward in both directions?
The URL
http://ab.deis a valid URL, which is clickable on every character except the colon and the first slash. Looking at the code, it seems, thatfind_colon_slash()doesn't quite do what you may have thought it does or does something different than what it was supposed to do. When hovering over the colon, the URL is short enough so that the search starts outside (to the right of) the URL andif (!is_url_char(ch)) return false;returns immediately because the character outside the URL will not be a valid URL character. The code seems a bit too complicated. May I try to rewrite it to search from the position of the mouse cursor outward in both directions?