Mercurial > vim-gutentags
comparison autoload/gutentags.vim @ 251:e61d20280c6c
Fix some more spaces-in-paths issues.
When using the tags cache directory, the project root is passed to ctags.
Escaping this path didn't work correctly when it has spaces:
- We remove the quotes around it on *nix because `job_start()` doesn't
like those, but then we need to escape the spaces with backslashes
otherwise the script doesn't understand those parameters.
- Once the escaping is gone in the script, we need to quote them but it
looks like sh doesn't like double quotes in the middle of an env var
or something, so we need to put the project root in a separate env
var.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Fri, 25 Oct 2019 23:52:12 -0700 |
parents | d264db0126c2 |
children | 52be4cf89810 |
comparison
equal
deleted
inserted
replaced
250:d264db0126c2 | 251:e61d20280c6c |
---|---|
112 " Thanks Vimscript... you can use negative integers for strings | 112 " Thanks Vimscript... you can use negative integers for strings |
113 " in the slice notation, but not for indexing characters :( | 113 " in the slice notation, but not for indexing characters :( |
114 let l:arglen = strlen(cmdarg) | 114 let l:arglen = strlen(cmdarg) |
115 if (cmdarg[0] == '"' && cmdarg[l:arglen - 1] == '"') || | 115 if (cmdarg[0] == '"' && cmdarg[l:arglen - 1] == '"') || |
116 \(cmdarg[0] == "'" && cmdarg[l:arglen - 1] == "'") | 116 \(cmdarg[0] == "'" && cmdarg[l:arglen - 1] == "'") |
117 call add(l:outcmd, cmdarg[1:-2]) | 117 " This was quoted, so there are probably things to escape. |
118 let l:escapedarg = cmdarg[1:-2] " substitute(cmdarg[1:-2], '\ ', '\\ ', 'g') | |
119 call add(l:outcmd, l:escapedarg) | |
118 else | 120 else |
119 call add(l:outcmd, cmdarg) | 121 call add(l:outcmd, cmdarg) |
120 endif | 122 endif |
121 endfor | 123 endfor |
122 return l:outcmd | 124 return l:outcmd |