Skip to content

Commit

Permalink
Check existing tags file as an opt-in thing for now.
Browse files Browse the repository at this point in the history
Looks like tags files don't all start with the `!_TAG_` magic header so I'm
disabling it by default for now.
  • Loading branch information
ludovicchabant committed Oct 15, 2015
1 parent 6fb68a3 commit 3048bf9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion autoload/gutentags/ctags.vim
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ if !exists('g:gutentags_ctags_options_file')
let g:gutentags_ctags_options_file = '.gutctags'
endif

if !exists('g:gutentags_ctags_check_tagfile')
let g:gutentags_ctags_check_tagfile = 0
endif

" }}}

" Gutentags Module Interface {{{
Expand All @@ -42,7 +46,7 @@ function! gutentags#ctags#generate(proj_dir, tags_file, write_mode) abort
let l:work_dir = fnamemodify(a:tags_file, ':h')
let l:tags_file_exists = filereadable(a:tags_file)

if l:tags_file_exists
if l:tags_file_exists && g:gutentags_ctags_check_tagfile
let l:first_lines = readfile(a:tags_file, '', 1)
if len(l:first_lines) == 0 || stridx(l:first_lines[0], '!_TAG_') != 0
call gutentags#throw("File ".a:tags_file." doesn't appear to be ".
Expand Down

0 comments on commit 3048bf9

Please sign in to comment.