changeset 249:36dabe30ab6e

Double escape spaces when setting tags path
author Yukun Lin <me@yukun.io>
date Mon, 05 Aug 2019 22:09:31 +0900
parents 57654e0dea1c
children d264db0126c2
files autoload/gutentags/ctags.vim
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/autoload/gutentags/ctags.vim	Sun May 05 22:20:27 2019 -0700
+++ b/autoload/gutentags/ctags.vim	Mon Aug 05 22:09:31 2019 +0900
@@ -53,7 +53,13 @@
 
     " Set the tags file for Vim to use.
     if g:gutentags_ctags_auto_set_tags
-        execute 'setlocal tags^=' . fnameescape(b:gutentags_files['ctags'])
+        if has('win32') || has('win64')
+            execute 'setlocal tags^=' . fnameescape(b:gutentags_files['ctags'])
+        else
+            " spaces must be literally escaped in tags path
+            let l:literal_space_escaped = substitute(fnameescape(b:gutentags_files['ctags']), '\ ', '\\\\ ', 'g')
+            execute 'setlocal tags^=' . l:literal_space_escaped
+        endif
     endif
 
     " Check if the ctags executable exists.