junegunn / fzf.vim

fzf :heart: vim
MIT License
9.51k stars 581 forks source link

Splits with WinBar change size when opening and closing FZF #1501

Open maybeetree opened 10 months ago

maybeetree commented 10 months ago

Splits with WinBar change size when opening and closing FZF

Description

If a split has a WinBar, opening and closing FZF in the split above it causes it to shrink. Video demonstration of this bug: https://asciinema.org/a/nYiOnge1cr5FXbbAcc4pLZGF6

How to reproduce

  1. Launch vim with vim --clean -Nu <(curl https://gist.githubusercontent.com/junegunn/6936bf79fedd3a079aeb1dd2f3c81ef5/raw)
  2. Wait for vim-plug to install everything
  3. Close the split created by vim-plug so that the window contains one empty split
  4. Split the window horizontally, such that there are two splits, one above the other
  5. Switch to the BOTTOM split
  6. In the BOTTOM split, run the following vim command in order to create a WinBar: :nnoremenu 1.10 WinBar.Step :Step<CR>
  7. Switch to the TOP split
  8. In the TOP split, run the following vim command: :FZF
  9. Press ESC to close the FZF popup

Expected behavior

The sizes of the two splits stay the same

Actual behavior

The bottom split shrinks by one line. Repeating the last two steps keeps on shrinking the split, until it becomes unusably small.

Why would anyone care?

Vimspector is another popular plugin that uses WinBar heavily. This issue is a major inconvenience for people who want to use Vimspector and fzf.vim together. They are left with three chpices: disabling WinBar support in Vimspector (let g:vimspector_enable_winbar=0); constantly re-adjusting the size of their splits; or trying to avoid using fzf when debugging. None of these are satisfactory.