You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[vim] Move and resize popup window when detecting VimResized event #4778
When opening this layout in a 80x24 terminal, the size of fzf is 72x14.
If we resize the terminal to a larger size, we would expect fzf to grow, but instead it stays at 72x14.
This behavior is shown perfectly by this video in fzf.vim.
The solution
Vim and Neovim offer a VimResized event and functions to resize and move popups/windows.
I introduce the s:resize_popup() function, which repeats the calculation of width/height/offset with the updated terminal size, and then moves and resizes the popup.
I've tested the changes on Vim (9.1) and Neovim (0.9.5).
Glad it works! I'm unable to test the changes right now, but from the looks of it that should be all correct.
I agree that clearing VimResized is better. As for a guard for Vim to check if the popup is valid, from what I understand popup_move does nothing if the popup is invalid. Still, safer to add a guard like you did.
If everything works on your end, feel free to cherry pick my commit and add your changes.
Activity
junegunn commentedon Apr 18, 2026
Thanks, I'll take a look.
junegunn commentedon Apr 19, 2026
Thanks, it works well with Vim and Neovim. I have two questions on the patch:
VimResizedautocmd is never cleared. Is it possible to clear it when fzf terminates?nvim_win_is_validins:resize_popupfor vim?junegunn commentedon Apr 19, 2026
Something like this?
Vulcalien commentedon Apr 19, 2026
Glad it works! I'm unable to test the changes right now, but from the looks of it that should be all correct.
I agree that clearing VimResized is better. As for a guard for Vim to check if the popup is valid, from what I understand
popup_movedoes nothing if the popup is invalid. Still, safer to add a guard like you did.If everything works on your end, feel free to cherry pick my commit and add your changes.
junegunn commentedon Apr 19, 2026
Merged to master. Thanks!
[vim] Move and resize popup window when detecting VimResized event
build(deps): update junegunn/fzf to v0.72.0