mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-01 12:42:01 -07:00
[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:
@@ -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))
|
||||
|
||||
|
Reference in New Issue
Block a user