Skip to content

Commit c5848be

Browse files
committed
Improve bang handling
1 parent ffa0dee commit c5848be

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plugin/tags.vim

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ if !exists('g:vim_tags_gems_tags_command')
3636
let g:vim_tags_gems_tags_command = "ctags -R -f Gemfile.lock.tags `bundle show --paths` 2>/dev/null &"
3737
endif
3838

39-
command! -bang -nargs=0 TagsGenerate :call s:generate_tags('<bang>', 1)
39+
command! -bang -nargs=0 TagsGenerate :call s:generate_tags(<bang>0, 1)
4040

4141
" Generate options and custom dirs list
4242
let options = []
@@ -58,7 +58,7 @@ let s:options = join(options, ' ')
5858

5959
fun! s:generate_tags(bang, redraw)
6060
"Remove existing tags
61-
if a:bang == '!'
61+
if a:bang
6262
for f in split(globpath('.', '*.tags', 1), '\n') + ['tags']
6363
call writefile([], f, 'b')
6464
endfor
@@ -101,5 +101,5 @@ fun! s:generate_tags(bang, redraw)
101101
endfun
102102

103103
if filereadable('tags') && g:vim_tags_auto_generate
104-
au BufWritePost * call s:generate_tags('', 0)
104+
au BufWritePost * call s:generate_tags(0, 0)
105105
endif

0 commit comments

Comments
 (0)