Skip to content
Myr

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

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fix https://github.com/junegunn/fzf.vim/issues/1116

authored by Junegunn Choi · committed by Junegunn Choi · parent d785135 · Browse files · 3 files+8 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+8 added−8 removed

  • other:+8 added−8 removed

3 files+8 added−8 removed

modified:doc/fzf.txt+2 added-2 removed
303 unmodified lines
304When `window` entry is a dictionary, fzf will start in a popup window. The305following options are allowed:306307 - Required:308 - `width` [float range [0 ~ 1]]309 - `height` [float range [0 ~ 1]]308 - `width` [float range [0 ~ 1]] or [integer range [8 ~ ]]309 - `height` [float range [0 ~ 1]] or [integer range [4 ~ ]]310 - Optional:311 - `yoffset` [float default 0.5 range [0 ~ 1]]312 - `xoffset` [float default 0.5 range [0 ~ 1]]313 - `highlight` [string default `'Comment'`]: Highlight group for border
134 unmodified lines
modified:plugin/fzf.vim+2 added-2 removed
862 unmodified lines
863 " Support ambiwidth == 'double'864 let ambidouble = &ambiwidth == 'double' ? 2 : 1865866 " Size and position867 let width = min([max([0, float2nr(&columns * a:opts.width)]), &columns])867 let width = min([max([8, a:opts.width > 1 ? a:opts.width : float2nr(&columns * a:opts.width)]), &columns])868 let width += width % ambidouble869 let height = min([max([0, float2nr(&lines * a:opts.height)]), &lines - has('nvim')])869 let height = min([max([4, a:opts.height > 1 ? a:opts.height : float2nr(&lines * a:opts.height)]), &lines - has('nvim')])870 let row = float2nr(get(a:opts, 'yoffset', 0.5) * (&lines - height))871 let col = float2nr(get(a:opts, 'xoffset', 0.5) * (&columns - width))872873 " Managing the differences
82 unmodified lines
modified:README-VIM.md+4 added-4 removed
288 unmodified lines
289When `window` entry is a dictionary, fzf will start in a popup window. The290following options are allowed:291292- Required:293 - `width` [float range [0 ~ 1]]294 - `height` [float range [0 ~ 1]]293 - `width` [float range [0 ~ 1]] or [integer range [8 ~ ]]294 - `height` [float range [0 ~ 1]] or [integer range [4 ~ ]]295- Optional:296 - `yoffset` [float default 0.5 range [0 ~ 1]]297 - `xoffset` [float default 0.5 range [0 ~ 1]]298 - `highlight` [string default `'Comment'`]: Highlight group for border
86 unmodified lines
385#### Starting fzf in a popup window386387```vim388" Required:389" - width [float range [0 ~ 1]]390" - height [float range [0 ~ 1]]389" - width [float range [0 ~ 1]] or [integer range [8 ~ ]]390" - height [float range [0 ~ 1]] or [integer range [4 ~ ]]391"392" Optional:393" - xoffset [float default 0.5 range [0 ~ 1]]394" - yoffset [float default 0.5 range [0 ~ 1]]
41 unmodified lines