-
Notifications
You must be signed in to change notification settings - Fork 220
bug: Snacks image placement off by one in floating window when using Bufferline.nvim #1557
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
Comments
One workaround / possible solution. Change the code referenced above to:
I'm not sure how to handle the case where showtabline = 1. I haven't found an API for "tabline is shown". |
I think this does it:
|
Submitted PR with the above change |
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 issue was closed because it has been stalled for 7 days with no activity. |
Did you check docs and existing issues?
Neovim version (nvim -v)
NVIM v0.10.4
Operating system/version
Arch Linux 6.13.5
Describe the bug
I've actually tracked it down to the following code in Snacks.image.placement.render_fallback, I'm just not certain of the correct/best solution:
384 local pos = vim.api.nvim_win_get_position(win)
385 terminal.set_cursor({ pos[1] + 1 + border.top, pos[2] + border.left })
When Bufferline Nvim is enabled, this results in a blank line above the image and the bottom of the image running into the bottom of the floating window frame (i.e. changing it to "pos[1] + 0 + border.top..." corrects the behavior with Bufferline enabled, but then breaks it otherwise).
Steps To Reproduce
I noticed this when running under WezTerm as "placeholders" is false, but can reproduce under kitty by modifying terminal.lua to make it use "render_fallback". Disabling bufferline.nvim also corrects the output, so it's a required factor.
Expected Behavior
Image output should render inside the floating window box regardless of bufferline.nvim being enabled or not.
The text was updated successfully, but these errors were encountered: