# HG changeset patch # User Ludovic Chabant # Date 1456078964 28800 # Node ID e03a661dc9831a7d5e6b1789578fb3c52c3ecd6a # Parent 74528efaa5eb02fe5b1e0c4b708f36008bec73c6 Some `ctags` implementations can't handle spaces in paths. diff -r 74528efaa5eb -r e03a661dc983 autoload/gutentags/ctags.vim --- a/autoload/gutentags/ctags.vim Sun Feb 21 10:21:43 2016 -0800 +++ b/autoload/gutentags/ctags.vim Sun Feb 21 10:22:44 2016 -0800 @@ -22,6 +22,10 @@ let g:gutentags_ctags_check_tagfile = 0 endif +if !exists('g:gutentags_ctags_no_space_in_paths') + let g:gutentags_ctags_no_space_in_paths = 1 +endif + " }}} " Gutentags Module Interface {{{ @@ -30,8 +34,15 @@ function! gutentags#ctags#init(project_root) abort " Figure out the path to the tags file. + if g:gutentags_ctags_no_space_in_paths + " We need to replace spaces in the project root because `ctags` seems + " incapable of reading/writing to tags files with spaces. + let l:fixed_project_root = tr(a:project_root, ' ', '_') + else + let l:fixed_project_root = a:project_root + endif let b:gutentags_files['ctags'] = gutentags#get_cachefile( - \a:project_root, g:gutentags_tagfile) + \l:fixed_project_root, g:gutentags_tagfile) " Set the tags file for Vim to use. if g:gutentags_auto_set_tags