-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ge
and gE
don't work properly with text fragments
#4564
Comments
Perhaps of interest to you @UncleSnail ? :) |
I don't really use those commands, or almost ever use text fragments, so I can't speak into them too much. It does appear that the ge/E functionality is incorrect, and it should probably include the text fragment, although that behavior might be intentional. The But I also don't want to go change how these commands parse URLs when I don't actually understand how they are intended to do so. So I'd say this is probably a bug, and I theoretically could fix it, but it might not be a bug and it's not really in a domain I am familiar with. |
I tried taking a quick look and it doesn't seem like there's any cutting of extra stuff. Though, I might as well completely misunderstand: https://github.com/philc/vimium/blob/master/content_scripts/vomnibar.js#L42-L48 |
Good point. The code you point out there uses the In the Text fragment doc it says "In a similar manner to document fragments, text fragments are appended onto a URL after a hash symbol (#).", which would imply that text fragments are different and potentially "aren't considered a part of the URL" (they are appended on the end, not a part of it?), so that could make sense. Also of note from the same page is "Text fragments are invoked only on full (non-same-page), user-initiated navigations." which might give us trouble using them in a URL edit anyway. The case that does work, I can see the use of having text fragment support, although editing one that is in the URL already doesn't seem very frequently useful (text fragments are more for sharing links, not typing them and going there yourself. You can still edit the current URL, type a text fragment on the end, copy it, and share, but if text fragments are supported somewhere, it's true we should support them everywhere. Currently you can edit to add a text fragment and it works mostly properly as long as the fragment is one word, or you encode the URI component yourself: IE, don't type spaces). Something that I would potentially use them for in vimium is if there were a single command to add the highlighted text to a text fragment, then copy that URL to the clipboard for sharing. That would be very convenient for referencing web pages, and I'd happily look into building that feature if Phil thinks it's a good idea. Chrome has a "Copy Link to Highlight" feature on right click that does this, but I don't know of a good way to do it in Firefox (without an addon). A keypress in Vimium for this functionality would be nicer though. |
Describe the bug
When at a URL that has a text fragment and pressing
ge
orgE
, the text fragment part of the URL is not shown in the vomnibar.Interestingly,
yy
works fine.Also, while at the URL mentioned below, pressing
gu
doesn't seem to do anything, whilegU
correctly sends you to https://example.com/. I'm not sure whether I wantgu
to do the same asgU
, here, but it certainly felt a little weird for the text fragment to stay.To Reproduce
ge
orgE
Browser and Vimium version
Firefox 131.0.3-1
macOS Sequoia 15.0.1
Vimium 2.1.2
The text was updated successfully, but these errors were encountered: