Include filename is ctags call when recurse option isn't present

This commit is contained in:
Michael Campagnaro 2021-12-02 22:37:26 -05:00
parent 3d91c1d4f0
commit 7c5dc3cd7c

11
vimrc
View File

@ -565,9 +565,14 @@ augroup campoCmds
" Include local variables for C-like languages.
let l:ctags_cmd = 'ctags '.l:exclude_list.' '.g:campo_custom_ctags_args.' --c-types=+l --c++-types=+l -o newtags'
" If there's an error running ctags then this echo will cause the
" error msg to be displayed on a new line.
echo ''
" Add the filename to the ctags command if not running in recursive mode.
let l:recursive = matchstr(g:campo_custom_ctags_args, '\(-R\s\)\|\(-R$\)\|\(--recurse=yes\)\|\(--recurse\s\)\|\(--recurse$\)')
if l:recursive == ''
let l:ctags_cmd = l:ctags_cmd . ' ' . expand('%:t')
echo "Creating non-recursive ctags"
else
echo "Creating recursive ctags"
endif
" The ampersand at the end is to make this run in the background. I had to group the
" commands in parens to make the chained commands run in the background.