Update g:fzf_preview_window to be a list with optional toggle keys

- The default preview window option will be ['right', 'ctrl-/']
  regardless of screen width or <bang>
- This will also fix #1010
This commit is contained in:
Junegunn Choi
2020-10-22 16:58:43 +09:00
parent 0eb385065b
commit 44057cce0e
4 changed files with 51 additions and 30 deletions

View File

@@ -155,7 +155,9 @@ function! fzf#vim#with_preview(...)
else
let preview_cmd = fzf#shellescape(s:bin.preview)
endif
let preview += ['--preview', preview_cmd.' '.placeholder]
if len(placeholder)
let preview += ['--preview', preview_cmd.' '.placeholder]
end
if len(args)
call extend(preview, ['--bind', join(map(args, 'v:val.":toggle-preview"'), ',')])