-
Notifications
You must be signed in to change notification settings - Fork 46
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
Ideas for improving performance during macro execution #179
Comments
Interesting, Flash doesn't?
Try setting
https://github.com/ggandor/leap.nvim#smart-autojump. You might want to set either
Indeed, but for this we'd have to parse the content of a register being executed, which is a hackish thing in the first place, but on top of that, the sequence depends on the user's keymappings, so this is out of the question. Edit: Or maybe we could save the target if |
Well it works, but the labels are just way to unpredictible because of the bidirectional search and also potentially change due to the variable search pattern, so I can't really see myself using it for macros.
Yeah you're right, after further investigation it doesn't seem like the highlighting causes too much of an issue - it's mostly just the regex pattern I'm using to highlight URLs that seems to be the source of the laggy leaping.
Thanks, that's good to know! |
I like how leap works consistently with macros, and imo this is a really big selling point over alternatives like flash, but it doesn't always perform the best compared to using native
f
/F
(which is almost instantaneous), especially with custom hl groups and highlighting patterns (like for underlining urls on screen).Now this isn't specific to leap (sneak also suffers from poor performance during macro execution), but I do believe this can be improved. Just as a suggestion, I was thinking that during macro execution there is no need for leap to search for all occurences of a pattern on screen as the user has already determined the nth occurence to jump to during recording ahead of time. For instance, if the macro contains the search pattern is
[s]exf
or[s]ex{repeat key × 2}
, leap should only find the 2nd occurence ofex
, jump to it, and nothing more. Of course, this would be dependent on the safe labels the user has configured.One caveat I can see right now is that currently leap doesn't not always immediately jump to the first occurence of a pattern if there are many matches (18 or more). I thought this had to do how I configured the options
max_phase_one_targets
andmax_highlighted_traversal_targets
, but as far as I can tell, that doesn't seem to be the case. Right now I'm not really sure if this is a bug or not.Potential Bug?
As for highlighting, I believe that can be naively disabled during macro execution on the user's end with something like this:
But I think it would be cool if this functionality was built in, or maybe a configurable option that takes a custom function to be called during macro execution.
All in all, I'm not entirely sure how feasible this is or how much effort it would take. I just thought I would put it out there for discussion. Thanks for your consideration!
The text was updated successfully, but these errors were encountered: