Skip to content
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

Check invisible property of overlays for faster scanning of links #207

Closed
wants to merge 2 commits into from

Conversation

akirak
Copy link
Contributor

@akirak akirak commented Mar 21, 2022

Fixes #206.

This PR extends link-hint--find-property-with-value function to check invisible property of overlays. Now link-hint is fast even in the situation in the referred issue. The downside is an added complexity of the function.

Please feel free to merge the PR or edit it.

If there are numerous links in overlays with invisible property (e.g. in
org-mode buffers where some subtrees are folded), it can be extremely slow to
scan all links in the region of the window.
@noctuid
Copy link
Owner

noctuid commented Mar 21, 2022

I will have to take another look at how the invisibility handling currently works and invisible overlays. Is the problem just that link-hint currently only considers the invisible text property and not invisible overlays? If possible, I'd rather modify link-hint--find-visible-regions directly instead of the search helpers.

The first skipping of start-bound is unnecessary and doesn't make
much sense except for performance.
@akirak
Copy link
Contributor Author

akirak commented Mar 21, 2022

Is the problem just that link-hint currently only considers the invisible text property and not invisible overlays? If possible, I'd rather modify link-hint--find-visible-regions directly instead of the search helpers.

I think so, and your solution will probably be better.

@noctuid
Copy link
Owner

noctuid commented Apr 15, 2022

I switched away from avy--find-visible-regions a while ago because of another issue, but I'm wondering how avy gets away with not looking at invisible overlays. Ideally this change will be made in avy at some point, and we can just use their function. For now, I will try to improve link-hint's version once I have some time.

@akirak
Copy link
Contributor Author

akirak commented Apr 15, 2022

I see, thanks.

@akirak akirak closed this Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extremely slow when numerous links are contained in invisible overlays
2 participants