feature(image): add option to `Snacks.image.hover()` to close immediately on cursor move
Did you check the docs?
- [x] I have read all the snacks.nvim docs
Is your feature request related to a problem? Please describe.
The image features of Snacks.image are great, but can be a bit overbearing when using the automatic inline or float options. Manually calling Snacks.image.hover() is a great alternative but then locks the hover to show until moving away from the treesitter node. This is not necessarily the desired behavior if you want to simply look at it for a moment and then have it go away.
Describe the solution you'd like
It would be nice to have an option passed into Snacks.image.hover() that makes it a lot more aggressive in closing. Where it shows the hover immediately, but then closes it the second the cursor moves or another operation happens rather than lingering until I move outside of the treesitter node.
Describe alternatives you've considered
Other solutions could be just homebrewing this in my own configuration that when I execute Snacks.image.hover it creates a single execution autocommand on cursormoved to check if there is a Snacks.image window and then close it if it exists. This seems a bit heavy to add in a user configuration and would make more sense to be upstreamed since it seems pretty generally useful for users.
Additional context
No response
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This is not stale
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This isn't stale
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Not stale
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
not stale
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Not stale
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Not stale
you can easily add this yourself with an autocmd