diff --git a/README-VIM.md b/README-VIM.md index 89b6cd0..af514da 100644 --- a/README-VIM.md +++ b/README-VIM.md @@ -290,8 +290,8 @@ When `window` entry is a dictionary, fzf will start in a popup window. The following options are allowed: - Required: - - `width` [float range [0 ~ 1]] - - `height` [float range [0 ~ 1]] + - `width` [float range [0 ~ 1]] or [integer range [8 ~ ]] + - `height` [float range [0 ~ 1]] or [integer range [4 ~ ]] - Optional: - `yoffset` [float default 0.5 range [0 ~ 1]] - `xoffset` [float default 0.5 range [0 ~ 1]] @@ -386,8 +386,8 @@ The latest versions of Vim and Neovim include builtin terminal emulator ```vim " Required: -" - width [float range [0 ~ 1]] -" - height [float range [0 ~ 1]] +" - width [float range [0 ~ 1]] or [integer range [8 ~ ]] +" - height [float range [0 ~ 1]] or [integer range [4 ~ ]] " " Optional: " - xoffset [float default 0.5 range [0 ~ 1]] diff --git a/doc/fzf.txt b/doc/fzf.txt index a6deda6..e88f756 100644 --- a/doc/fzf.txt +++ b/doc/fzf.txt @@ -305,8 +305,8 @@ When `window` entry is a dictionary, fzf will start in a popup window. The following options are allowed: - Required: - - `width` [float range [0 ~ 1]] - - `height` [float range [0 ~ 1]] + - `width` [float range [0 ~ 1]] or [integer range [8 ~ ]] + - `height` [float range [0 ~ 1]] or [integer range [4 ~ ]] - Optional: - `yoffset` [float default 0.5 range [0 ~ 1]] - `xoffset` [float default 0.5 range [0 ~ 1]] diff --git a/plugin/fzf.vim b/plugin/fzf.vim index b26a545..2594bc4 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -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))