[fzf#vim#with_preview] Set --no-unicode if ambiwidth is 'double' (#1322)

Fix #1320

Append fzf argument `--no-unicode` when ambiwidth is `double` to keep the
preview window rendering correctly.
This commit is contained in:
Kevin Lin
2021-09-03 05:46:54 +08:00
committed by GitHub
parent a552e44810
commit 980cd07439

View File

@@ -178,6 +178,9 @@ function! fzf#vim#with_preview(...)
if len(placeholder) if len(placeholder)
let preview += ['--preview', preview_cmd.' '.placeholder] let preview += ['--preview', preview_cmd.' '.placeholder]
end end
if &ambiwidth ==# 'double'
let preview += ['--no-unicode']
end
if len(args) if len(args)
call extend(preview, ['--bind', join(map(args, 'v:val.":toggle-preview"'), ',')]) call extend(preview, ['--bind', join(map(args, 'v:val.":toggle-preview"'), ',')])