# HG changeset patch # User Ludovic Chabant # Date 1458963698 25200 # Node ID df3b0ca480139292e5a6524d264889cc045d0a07 # Parent 563fbba4328802eff7d37aa14e6dfa680da73627# Parent be8d47e88ab11603d24351b116f0201cc32de05c Merge pull request #64 from GitHub. diff -r 563fbba43288 -r df3b0ca48013 autoload/gutentags/ctags.vim --- a/autoload/gutentags/ctags.vim Fri Mar 25 19:32:31 2016 -0700 +++ b/autoload/gutentags/ctags.vim Fri Mar 25 20:41:38 2016 -0700 @@ -27,6 +27,7 @@ " Gutentags Module Interface {{{ let s:runner_exe = gutentags#get_plat_file('update_tags') +let s:unix_redir = (&shellredir =~# '%s') ? &shellredir : &shellredir . ' %s' function! gutentags#ctags#init(project_root) abort " Figure out the path to the tags file. @@ -63,7 +64,7 @@ endif endif - if g:gutentags_cache_dir == "" + if empty(g:gutentags_cache_dir) " If we don't use the cache directory, let's just use the tag filename " as specified by the user, and change the working directory to the " project root. @@ -93,7 +94,7 @@ " 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 . '/' . + 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( @@ -113,11 +114,11 @@ if has('win32') let l:cmd .= ' -l "' . l:actual_tags_file . '.log"' else - let l:cmd .= ' > "' . l:actual_tags_file . '.log" 2>&1' + let l:cmd .= ' ' . printf(s:unix_redir, '"' . l:actual_tags_file . '.log"') endif else if !has('win32') - let l:cmd .= ' > /dev/null 2>&1' + let l:cmd .= ' ' . printf(s:unix_redir, '/dev/null') endif endif let l:cmd .= gutentags#get_execute_cmd_suffix() @@ -163,7 +164,7 @@ endfunction function! s:process_options_file(proj_dir, path) abort - if g:gutentags_cache_dir == "" + if empty(g:gutentags_cache_dir) " If we're not using a cache directory to store tag files, we can " use the options file straight away. return a:path @@ -228,4 +229,3 @@ endfunction " }}} -