mirror of
https://github.com/junegunn/fzf.vim.git
synced 2025-12-06 20:54:28 +08:00
@@ -44,6 +44,7 @@ if s:is_win
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let s:wide = 120
|
let s:wide = 120
|
||||||
|
let s:warned = 0
|
||||||
|
|
||||||
function! s:extend_opts(dict, eopts, prepend)
|
function! s:extend_opts(dict, eopts, prepend)
|
||||||
if empty(a:eopts)
|
if empty(a:eopts)
|
||||||
@@ -76,9 +77,6 @@ endfunction
|
|||||||
" [[options to wrap], [preview window expression], [toggle-preview keys...]]
|
" [[options to wrap], [preview window expression], [toggle-preview keys...]]
|
||||||
function! fzf#vim#with_preview(...)
|
function! fzf#vim#with_preview(...)
|
||||||
let bash_path = exepath('bash')
|
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$'
|
let is_wsl_bash = bash_path =~? 'Windows[/\\]system32[/\\]bash.exe$'
|
||||||
" Default options
|
" Default options
|
||||||
let options = {}
|
let options = {}
|
||||||
@@ -92,6 +90,14 @@ function! fzf#vim#with_preview(...)
|
|||||||
call remove(args, 0)
|
call remove(args, 0)
|
||||||
endif
|
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)
|
" Placeholder expression (TODO/TBD: undocumented)
|
||||||
let placeholder = get(options, 'placeholder', '{}')
|
let placeholder = get(options, 'placeholder', '{}')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user