diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 7e3046a..b024c92 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -842,8 +842,12 @@ else endif function! s:popup(opts) abort + " Support ambiwidth == 'double' + let ambidouble = &ambiwidth == 'double' ? 2 : 1 + " Size and position let width = min([max([0, float2nr(&columns * a:opts.width)]), &columns]) + let width += width % ambidouble let height = min([max([0, 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)) @@ -861,15 +865,15 @@ function! s:popup(opts) abort endif if style == 'horizontal' - let hor = repeat('─', width) + let hor = repeat('─', width / ambidouble) let mid = repeat(' ', width) let border = [hor] + repeat([mid], height - 2) + [hor] let margin = 0 else let edges = style == 'sharp' ? ['┌', '┐', '└', '┘'] : ['╭', '╮', '╰', '╯'] - let bar = repeat('─', width - 2) + let bar = repeat('─', width / ambidouble - 2) let top = edges[0] .. bar .. edges[1] - let mid = '│' .. repeat(' ', width - 2) .. '│' + let mid = '│' .. repeat(' ', width - 2 * ambidouble) .. '│' let bot = edges[2] .. bar .. edges[3] let border = [top] + repeat([mid], height - 2) + [bot] let margin = 2