Closed duianto closed 6 years ago
The slash still gets shifted if there's anything written right before https
, like this:
(https://google.com
, it doesn't seem to matter where the cursor is located, link-hint-copy-link
results in: /https:/google.com
. But the cursor has to be on the url for it to happen with the link-hint-copy-link-at-point
command.
This line thisisaurlhttps://google.com
results in: /thisisaurlhttps:/google.com
.
This probably never happens, but if a backslash is after a url: https://google.com\
and the cursor is on the backslash, when one calls link-hint-copy-link-at-point
, then one of the forward slashes also moves to the start: /https:/google.com\
.
It's with the latest version: link-hint-20170313.1945
It looks like url-util.el
expects there to be nothing before the url, so it doesn't detect anything at the point. It then falls through to ffap
which messes up the url. It looks like thing-at-point
doesn't have this problem, so I'll probably switch to using it.
Edit: It looks like url-util will work with other characters before the url but not an open paren.
The paren case (which is definitely a legitimate issue) is handled correctly now since thing-at-point
is used to check for a url first. The backslash case doesn't work by default, but the url regexp can be changed if anyone wants this case to work.
Description
When
link-hint-copy-link-at-point
is called with the cursor on any other letter in a url than the first, then the url gets copied to the clipboard but, one of the double slashes has moved to the start of the url.Steps to reproduce
link-hint
package installed).C-x b
Type:new
Press:RET
.https://google.com
into thenew
buffer.h
.M-x
Type:link-hint-copy-link-at-point
Press:RET
Observed behaviour
The clipboard now contains:
/https:/google.com
System info
Windows 10 1607 (OS Build 14393.693) GNU Emacs 25.1.1 (x86_64-w64-mingw32) of 2016-09-17 avy-20170208.148 link-hint-20161216.857