noctuid/link-hint.el

Position is Restored in Incorrect Buffer or When It Shouldn't Be

blaenk opened this issue · 4 comments

When I check the help of a function and I click on the linked name of the file, it opens the file and jumps to the section that defines the function. When I use ace-link-help it also does this. When I use link-hint it seems to simply jump to the beginning of the file.

It actually is jumping to the correct location, but with the current code, the point is reset afterwards. I have some uncommitted code that will fix this by differentiating between link types to prevent this. I'll also add an option to never reset the point (like with ace-link). This is also a problem for trying to open links that won't change buffers (e.g. "[[Heading-name]]" in org-mode). Sorry for the inconvenience; I'd meant to get around to fixing this sooner.

For now, I've fixed the specific part of this bug that was affecting help links, so it should work as expected.

No problem at all. Glad you were already aware of this, I was just reporting it in case you weren't 👌

Actually, I'm going to keep this open to remind myself to add an option to have the point always moved.

Also, in some cases it is possible to both open links that should and shouldn't move the point within the buffer (e.g. opening all links where there is a url link and a link to an org heading in the current file). I don't know if it would actually be useful, but I guess I could also have the all links and multiple links commands move the point to the org heading in that situation. I think this behavior might just be confusing, so I'll think about it more.