changeset 86:7872cc9bbc2d

Check existing tags file as an opt-in thing for now. Looks like tags files don't all start with the `!_TAG_` magic header so I'm disabling it by default for now.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 14 Oct 2015 19:31:50 -0700
parents 0424970d81f8
children afe113047204
files autoload/gutentags/ctags.vim
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/autoload/gutentags/ctags.vim	Fri Oct 09 15:28:39 2015 -0700
+++ b/autoload/gutentags/ctags.vim	Wed Oct 14 19:31:50 2015 -0700
@@ -18,6 +18,10 @@
     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 {{{
@@ -42,7 +46,7 @@
     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 ".