Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Automatically disable Bling when running macros #18

Closed
ChausseBenjamin opened this issue Nov 18, 2020 · 3 comments
Closed

Automatically disable Bling when running macros #18

ChausseBenjamin opened this issue Nov 18, 2020 · 3 comments

Comments

@ChausseBenjamin
Copy link

The plugin is really great. The only thing I currently find lacking is a simple way to have Bling automatically disable itself when running macros...
If I run a macro multiple times, It's a lot longer to run if every times it finds a pattern (with N or n), it blinks.
A flag (say let g:BlingDisableOnMacro=1) would be great implementation for this!

@ivyl
Copy link
Owner

ivyl commented Nov 18, 2020

I think this makes a lot of sense, even as the default.

Sadly, I haven't found a way to tell when something is executed as a part of a macro. According to the docs (@): "The register is executed like a mapping", but there's also no way to figure out we are inside macro either.

If you find something let me know.

@cd-a
Copy link

cd-a commented Feb 17, 2022

In lightspeed you can handle it like this: ggandor/lightspeed.nvim#7 (comment)

Maybe this would be applicable here as well?

@ChausseBenjamin
Copy link
Author

I'm not enough of a vim ninja to know if this is possible but perhaps a timer could do the trick.
When vim-bling is called, it start a timer (say 100ms). This timer should be asynchronous so that it doesn't stall vim while waiting for it to end. Then if vim-bling is called withing that 100ms threshold, it disables itself until it gets called with a human sensible delay. This would probably also disable vim-bling when a user holds down the n key and when it's used along a motion (like typing12n or 12N). What do you guys think?

@ivyl ivyl closed this as completed in 5e59a06 Jul 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants