# HG changeset patch # User Ludovic Chabant # Date 1438144212 25200 # Node ID 208130c6245e9000a505c3d030a0630e574ffe07 # Parent fa749380e05a5ce04e5c4e24e336813034fa72f2# Parent 892da510cdd23933d392d53bda6e2644b38bc9c1 Merge pull request #36 from GitHub. diff -r 892da510cdd2 -r 208130c6245e autoload/gutentags.vim --- a/autoload/gutentags.vim Tue Jul 28 04:23:18 2015 +0300 +++ b/autoload/gutentags.vim Tue Jul 28 21:30:12 2015 -0700 @@ -46,6 +46,11 @@ return g:gutentags_plat_dir . a:filename . g:gutentags_script_ext endfunction +" Gets a file path in the resource folder. +function! gutentags#get_res_file(filename) abort + return g:gutentags_res_dir . a:filename +endfunction + " }}} " Gutentags Setup {{{ diff -r 892da510cdd2 -r 208130c6245e autoload/gutentags/ctags.vim --- a/autoload/gutentags/ctags.vim Tue Jul 28 04:23:18 2015 +0300 +++ b/autoload/gutentags/ctags.vim Tue Jul 28 21:30:12 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"' diff -r 892da510cdd2 -r 208130c6245e plat/unix/update_tags.sh --- a/plat/unix/update_tags.sh Tue Jul 28 04:23:18 2015 +0300 +++ b/plat/unix/update_tags.sh Tue Jul 28 21:30:12 2015 -0700 @@ -79,8 +79,8 @@ fi echo "Running ctags" -echo "$CTAGS_EXE -R -f \"$TAGS_FILE.temp\" $CTAGS_ARGS \"$PROJECT_ROOT\"" -$CTAGS_EXE -R -f "$TAGS_FILE.temp" $CTAGS_ARGS "$PROJECT_ROOT" +echo "$CTAGS_EXE -f \"$TAGS_FILE.temp\" $CTAGS_ARGS \"$PROJECT_ROOT\"" +$CTAGS_EXE -f "$TAGS_FILE.temp" $CTAGS_ARGS "$PROJECT_ROOT" echo "Replacing tags file" echo "mv -f \"$TAGS_FILE.temp\" \"$TAGS_FILE\"" diff -r 892da510cdd2 -r 208130c6245e plat/win32/update_tags.cmd --- a/plat/win32/update_tags.cmd Tue Jul 28 04:23:18 2015 +0300 +++ b/plat/win32/update_tags.cmd Tue Jul 28 21:30:12 2015 -0700 @@ -83,8 +83,8 @@ ) echo Running ctags >> %LOG_FILE% -echo call "%CTAGS_EXE%" -R -f "%TAGS_FILE%.temp" %CTAGS_ARGS% "%PROJECT_ROOT%" >> %LOG_FILE% -call "%CTAGS_EXE%" -R -f "%TAGS_FILE%.temp" %CTAGS_ARGS% "%PROJECT_ROOT%" >> %LOG_FILE% 2>&1 +echo call "%CTAGS_EXE%" -f "%TAGS_FILE%.temp" %CTAGS_ARGS% "%PROJECT_ROOT%" >> %LOG_FILE% +call "%CTAGS_EXE%" -f "%TAGS_FILE%.temp" %CTAGS_ARGS% "%PROJECT_ROOT%" >> %LOG_FILE% 2>&1 if ERRORLEVEL 1 ( echo ERROR: Ctags executable returned non-zero code. >> %LOG_FILE% goto :Unlock diff -r 892da510cdd2 -r 208130c6245e plugin/gutentags.vim --- a/plugin/gutentags.vim Tue Jul 28 04:23:18 2015 +0300 +++ b/plugin/gutentags.vim Tue Jul 28 21:30:12 2015 -0700 @@ -69,6 +69,9 @@ if !exists('g:gutentags_cache_dir') let g:gutentags_cache_dir = '' else + " Make sure we get an absolute/resolved path (e.g. expanding `~/`), and + " strip any trailing slash. + let g:gutentags_cache_dir = fnamemodify(g:gutentags_cache_dir, ':p') let g:gutentags_cache_dir = fnamemodify(g:gutentags_cache_dir, ':s?[/\\]$??') endif @@ -82,9 +85,11 @@ if has('win32') let g:gutentags_plat_dir = expand(':h:h:p') . "\\plat\\win32\\" + let g:gutentags_res_dir = expand(':h:h:p') . "\\res\\" let g:gutentags_script_ext = '.cmd' else let g:gutentags_plat_dir = expand(':h:h:p') . '/plat/unix/' + let g:gutentags_res_dir = expand(':h:h:p') . '/res/' let g:gutentags_script_ext = '.sh' endif diff -r 892da510cdd2 -r 208130c6245e res/ctags.options --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/res/ctags.options Tue Jul 28 21:30:12 2015 -0700 @@ -0,0 +1,2 @@ +--recurse=yes +