snacks.nvim icon indicating copy to clipboard operation
snacks.nvim copied to clipboard

feat(image): use a bufvar for unnamed scratch preview buffer

Open phanen opened this issue 9 months ago • 1 comments

I'm try integrate snacks.image into fzf-lua.

When use scratch previewer buffer, to determine the real filename a src must be explicitly given.

I don't if this way is proper but I think something should be done here..

https://github.com/ibhagwan/fzf-lua/pull/1913

phanen avatar Mar 23 '25 03:03 phanen

This PR is stale because it has been open 30 days with no activity.

github-actions[bot] avatar May 19 '25 02:05 github-actions[bot]

This PR is stale because it has been open 30 days with no activity.

github-actions[bot] avatar Aug 14 '25 02:08 github-actions[bot]

This PR is stale because it has been open 30 days with no activity.

github-actions[bot] avatar Sep 15 '25 02:09 github-actions[bot]

I don't see why this is needed

folke avatar Oct 19 '25 09:10 folke

Sorry I should elaborate on it.

e.g. when you preview tests/image/test.svelte in a normal buffer, you can vim.api.nvim_buf_get_name(buf) to get its name. (test.svelte use local png name, have to be resolved to actual path)

But for preview buffer, it cannot have the same name as original buffer (since it's a scratch buffer copy of the original buffer). So I use a bufvar here as the source buffer name.

phanen avatar Oct 19 '25 09:10 phanen