diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 9cebed48..ee2ee906 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -978,13 +978,13 @@ function! s:popup(opts) abort " Use current window size for positioning relatively positioned popups let columns = relative ? winwidth(0) : &columns - let lines = relative ? winheight(0) : &lines + let lines = relative ? winheight(0) : (&lines - has('nvim')) " Size and position let width = min([max([8, a:opts.width > 1 ? a:opts.width : float2nr(columns * a:opts.width)]), columns]) - let height = min([max([4, a:opts.height > 1 ? a:opts.height : float2nr(lines * a:opts.height)]), lines - has('nvim')]) - let row = float2nr(yoffset * (lines - height)) + (relative ? win_screenpos(0)[0] : 0) - let col = float2nr(xoffset * (columns - width)) + (relative ? win_screenpos(0)[1] : 0) + let height = min([max([4, a:opts.height > 1 ? a:opts.height : float2nr(lines * a:opts.height)]), lines]) + let row = float2nr(yoffset * (lines - height)) + (relative ? win_screenpos(0)[0] - 1 : 0) + let col = float2nr(xoffset * (columns - width)) + (relative ? win_screenpos(0)[1] - 1 : 0) " Managing the differences let row = min([max([0, row]), &lines - has('nvim') - height])