Skip to content
Discussion options

You must be logged in to vote

There is a cleanup method one level below Snacks.image:

Snacks.image.doc.hover_close()
Snacks.image.placement.clean() -- all buffers; pass a buffer number to limit it

placement.clean() closes the tracked placements, including their terminal graphics and extmarks. It is also what Snacks uses when buffers are deleted and on exit.

One caveat for your toggle: changing config.enabled is not a full teardown. doc.attach() checks that flag when attaching, but an already attached inline renderer has its own update lifecycle and can create placements again. So the two calls above clear what's currently displayed; they are not, by themselves, a complete persistent disable/enable implementation.

For …

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@herrhodel
Comment options

@identity-wael
Comment options

Answer selected by herrhodel
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants