diff --git a/autoload/vim2hs/haskell/tags.vim b/autoload/vim2hs/haskell/tags.vim index 04f1bbe..a34e0b6 100644 --- a/autoload/vim2hs/haskell/tags.vim +++ b/autoload/vim2hs/haskell/tags.vim @@ -1,8 +1,13 @@ -function! vim2hs#haskell#tags#fasttags() " {{{ - silent !find -iname '*.hs' | xargs fast-tags +function! vim2hs#haskell#tags#fasttags(...) " {{{ + if a:0 + let l:files = map(copy(a:000), 'shellescape(v:val)') + execute 'silent !fast-tags ' . join(l:files) + else + silent !find * -iname '*.hs' | xargs fast-tags + endif endfunction " }}} function! vim2hs#haskell#tags#hasktags() " {{{ - silent !hasktags -c --ignore-close-implementation . + silent !hasktags -c --ignore-close-implementation * endfunction " }}} diff --git a/plugin/haskell_tags.vim b/plugin/haskell_tags.vim index 64d7e3e..3019b0b 100644 --- a/plugin/haskell_tags.vim +++ b/plugin/haskell_tags.vim @@ -11,7 +11,7 @@ endif if g:haskell_tags_generator ==# 'fast-tags' if !executable('fast-tags') | finish | endif - autocmd BufWritePost *.hs call vim2hs#haskell#tags#fasttags() + autocmd BufWritePost *.hs call vim2hs#haskell#tags#fasttags(expand('%')) call vim2hs#haskell#tags#fasttags() elseif g:haskell_tags_generator == 'hasktags' if !executable('hasktags') | finish | endif