diff autoload/gutentags/ctags.vim @ 75:d12543f11eb9

Move the default `-R` option to an overridable "global" options file. This makes it possible for a `.gutctags` file to disable the `-R` flag. Also fixes Github issue #33.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 27 Jul 2015 14:18:10 -0700
parents 661a97eaf608
children 96bfe5c37f37
line wrap: on
line diff
--- a/autoload/gutentags/ctags.vim	Sat Jul 18 08:52:14 2015 -0700
+++ b/autoload/gutentags/ctags.vim	Mon Jul 27 14:18:10 2015 -0700
@@ -52,6 +52,16 @@
             let l:full_path = expand('%:p')
             let l:cmd .= ' -s "' . l:full_path . '"'
         endif
+        " Pass the Gutentags options file first, and then the project specific
+        " one, so that users can override the default behaviour.
+        let l:cmd .= ' -o "' . gutentags#get_res_file('ctags.options') . '"'
+        let l:proj_options_file = a:proj_dir . '/' . 
+                    \g:gutentags_ctags_options_file
+        if filereadable(l:proj_options_file)
+            let l:proj_options_file = s:process_options_file(
+                        \a:proj_dir, l:proj_options_file)
+            let l:cmd .= ' -o "' . l:proj_options_file . '"'
+        endif
         for ign in split(&wildignore, ',')
             let l:cmd .= ' -x ' . '"' . ign . '"'
         endfor
@@ -61,13 +71,6 @@
         if g:gutentags_pause_after_update
             let l:cmd .= ' -c'
         endif
-        let l:proj_options_file = a:proj_dir . '/' . 
-                    \g:gutentags_ctags_options_file
-        if filereadable(l:proj_options_file)
-            let l:proj_options_file = s:process_options_file(
-                        \a:proj_dir, l:proj_options_file)
-            let l:cmd .= ' -o "' . l:proj_options_file . '"'
-        endif
         if g:gutentags_trace
             if has('win32')
                 let l:cmd .= ' -l "' . a:tags_file . '.log"'