[BTags] Fix "tag commnads" argument

This commit is contained in:
Junegunn Choi 2017-02-18 13:51:06 +09:00
parent dade777e6d
commit fcca65bbe5
No known key found for this signature in database
GPG key ID: 254BC280FEF9C627

View file

@ -701,9 +701,12 @@ endfunction
" query, [[tag commands], options] " query, [[tag commands], options]
function! fzf#vim#buffer_tags(query, ...) function! fzf#vim#buffer_tags(query, ...)
let args = copy(a:000) let args = copy(a:000)
let tag_cmds = len(args) > 1 ? remove(args, 0) : [ let tag_cmds = (len(args) > 1 && type(args[0]) != type({})) ? remove(args, 0) : [
\ printf('ctags -f - --sort=no --excmd=number --language-force=%s %s 2>/dev/null', &filetype, expand('%:S')), \ printf('ctags -f - --sort=no --excmd=number --language-force=%s %s 2>/dev/null', &filetype, expand('%:S')),
\ printf('ctags -f - --sort=no --excmd=number %s 2>/dev/null', expand('%:S'))] \ printf('ctags -f - --sort=no --excmd=number %s 2>/dev/null', expand('%:S'))]
if type(tag_cmds) != type([])
let tag_cmds = [tag_cmds]
endif
try try
return s:fzf('btags', { return s:fzf('btags', {
\ 'source': s:btags_source(tag_cmds), \ 'source': s:btags_source(tag_cmds),