vhakulinen / gnvim

GUI for neovim, without any web bloat
MIT License
1.85k stars 69 forks source link

fzf window layout is empty #144

Closed jtumano closed 1 year ago

jtumano commented 4 years ago

Hi! First of all thanks a lot for a great nvim gui.

There is an issue when using fzf window layout: config option is for example:

let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6 } }

resulted with an empty floating window: image

in terminal nvim it should look as image

after some tries I found that if I click on this empty window and "close" it by pressing Ctrl+W c then content will be shown, but without a border: image

vhakulinen commented 4 years ago

This is probably because fzf is creating a base window for a "frame" for the actual window that shows the contents (see https://github.com/junegunn/fzf/blob/master/plugin/fzf.vim#L909-L914). The "actual" window should specify the frame as a anchor window.

vhakulinen commented 4 years ago

Also, even if the anchor is specified, gnvim currently doesn't make sure that the stacking order of the windows is correct - so there is a bug in both fzf and gnvim.

vhakulinen commented 4 years ago

Meanwhile, FWIW, I'm using this for fzf layout:

let $FZF_DEFAULT_OPTS=' --layout=reverse --margin=1,4'
let g:fzf_layout = { 'window': 'call FloatingFZF()' }

function! FloatingFZF()
  let buf = nvim_create_buf(v:false, v:true)
  call setbufvar(buf, '&signcolumn', 'no')

  let height = 20
  let width = 120
  let horizontal = float2nr((&columns - width) / 2)
  let vertical = 1

  let opts = {
        \ 'relative': 'editor',
        \ 'row': vertical,
        \ 'col': horizontal,
        \ 'width': width,
        \ 'height': height,
        \ 'style': 'minimal'
        \ }

  call nvim_open_win(buf, v:true, opts)
endfunction
vhakulinen commented 1 year ago

Gnvim was rewritten from ground up for gtk4. If the problem persists, feel free to reopen this issue.