diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2020-09-06 22:12:51 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2020-09-06 22:15:44 +0900 |
| commit | 0db65c22d369026a0a9af079bfa7e8110e850ec9 (patch) | |
| tree | d339fe4de9d6ad773ece169be47a94ee9fc19a00 /plugin/fzf.vim | |
| parent | d7851356062d23250ad0fbee660a249c37460b40 (diff) | |
| download | fzf-0db65c22d369026a0a9af079bfa7e8110e850ec9.tar.gz | |
[vim] Allow specifying popup width and height in absolute integer value
Fix https://github.com/junegunn/fzf.vim/issues/1116
Diffstat (limited to 'plugin/fzf.vim')
| -rw-r--r-- | plugin/fzf.vim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim index b26a5455..2594bc41 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)) |
