diff --git a/autoload/fzf/vim.vim b/autoload/fzf/vim.vim index fb37c8e..039b085 100644 --- a/autoload/fzf/vim.vim +++ b/autoload/fzf/vim.vim @@ -44,6 +44,7 @@ if s:is_win endif let s:wide = 120 +let s:warned = 0 function! s:extend_opts(dict, eopts, prepend) if empty(a:eopts) @@ -76,9 +77,6 @@ endfunction " [[options to wrap], [preview window expression], [toggle-preview keys...]] function! fzf#vim#with_preview(...) let bash_path = exepath('bash') - if empty(bash_path) - throw 'bash is not in PATH' - endif let is_wsl_bash = bash_path =~? 'Windows[/\\]system32[/\\]bash.exe$' " Default options let options = {} @@ -92,6 +90,14 @@ function! fzf#vim#with_preview(...) call remove(args, 0) endif + if empty(bash_path) + if !s:warned + call s:warn('Preview window not supported (bash not found in PATH)') + let s:warned = 1 + endif + return options + endif + " Placeholder expression (TODO/TBD: undocumented) let placeholder = get(options, 'placeholder', '{}')