Respect preview-window value in FZF_DEFAULT_OPTS

when g:fzf_preview_window is not set, instead of overriding it with `right`.

Close #2378
This commit is contained in:
Junegunn Choi
2021-03-06 16:34:25 +09:00
parent 02a192ea0b
commit 711fb41e39

View File

@@ -140,7 +140,7 @@ function! fzf#vim#with_preview(...)
" g:fzf_preview_window
if empty(args)
let preview_args = get(g:, 'fzf_preview_window', ['right', 'ctrl-/'])
let preview_args = get(g:, 'fzf_preview_window', ['', 'ctrl-/'])
if empty(preview_args)
let args = ['hidden']
else
@@ -150,7 +150,7 @@ function! fzf#vim#with_preview(...)
endif
if len(args) && type(args[0]) == s:TYPE.string
if args[0] !~# '^\(up\|down\|left\|right\|hidden\)'
if len(args[0]) && args[0] !~# '^\(up\|down\|left\|right\|hidden\)'
throw 'invalid preview window: '.args[0]
endif
let window = args[0]