From 0db65c22d369026a0a9af079bfa7e8110e850ec9 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 6 Sep 2020 22:12:51 +0900 Subject: [vim] Allow specifying popup width and height in absolute integer value Fix https://github.com/junegunn/fzf.vim/issues/1116 --- plugin/fzf.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugin/fzf.vim') 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)) -- cgit v1.2.3