[vim] Allow specifying popup width and height in absolute integer value

Fix https://github.com/junegunn/fzf.vim/issues/1116
This commit is contained in:
Junegunn Choi
2020-09-06 22:12:51 +09:00
parent d785135606
commit 0db65c22d3
3 changed files with 8 additions and 8 deletions

View File

@@ -864,9 +864,9 @@ function! s:popup(opts) abort
let ambidouble = &ambiwidth == 'double' ? 2 : 1
" Size and position
let width = min([max([0, float2nr(&columns * a:opts.width)]), &columns])
let width = min([max([8, a:opts.width > 1 ? a:opts.width : float2nr(&columns * a:opts.width)]), &columns])
let width += width % ambidouble
let height = min([max([0, float2nr(&lines * a:opts.height)]), &lines - has('nvim')])
let height = min([max([4, a:opts.height > 1 ? a:opts.height : float2nr(&lines * a:opts.height)]), &lines - has('nvim')])
let row = float2nr(get(a:opts, 'yoffset', 0.5) * (&lines - height))
let col = float2nr(get(a:opts, 'xoffset', 0.5) * (&columns - width))