Fix code comments: options -> spec

This commit is contained in:
Junegunn Choi
2020-08-02 10:06:11 +09:00
parent 9cc54fb3d3
commit 23dda8602f

View File

@@ -74,19 +74,19 @@ function! s:prepend_opts(dict, eopts)
return s:extend_opts(a:dict, a:eopts, 1) return s:extend_opts(a:dict, a:eopts, 1)
endfunction endfunction
" [[options to wrap], [preview window expression], [toggle-preview keys...]] " [[spec 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')
let is_wsl_bash = bash_path =~? 'Windows[/\\]system32[/\\]bash.exe$' let is_wsl_bash = bash_path =~? 'Windows[/\\]system32[/\\]bash.exe$'
" Default options " Default spec
let options = {} let spec = {}
let window = '' let window = ''
let args = copy(a:000) let args = copy(a:000)
" Options to wrap " Spec to wrap
if len(args) && type(args[0]) == s:TYPE.dict if len(args) && type(args[0]) == s:TYPE.dict
let options = copy(args[0]) let spec = copy(args[0])
call remove(args, 0) call remove(args, 0)
endif endif
@@ -95,11 +95,11 @@ function! fzf#vim#with_preview(...)
call s:warn('Preview window not supported (bash not found in PATH)') call s:warn('Preview window not supported (bash not found in PATH)')
let s:warned = 1 let s:warned = 1
endif endif
return options return spec
endif endif
" Placeholder expression (TODO/TBD: undocumented) " Placeholder expression (TODO/TBD: undocumented)
let placeholder = get(options, 'placeholder', '{}') let placeholder = get(spec, 'placeholder', '{}')
" Preview window " Preview window
if len(args) && type(args[0]) == s:TYPE.string if len(args) && type(args[0]) == s:TYPE.string
@@ -126,8 +126,8 @@ function! fzf#vim#with_preview(...)
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"'), ',')])
endif endif
call s:merge_opts(options, preview) call s:merge_opts(spec, preview)
return options return spec
endfunction endfunction
function! s:remove_layout(opts) function! s:remove_layout(opts)