Mercurial > vim-gutentags
comparison autoload/gutentags.vim @ 262:dc9216fc0c0f
escape the file name in a right way, handle `tcd` in vim
author | skywind3000 <skywind3000@163.com> |
---|---|
date | Fri, 14 Feb 2020 13:12:34 +0800 |
parents | a282d08e0e7c |
children | cbe7ffc327a4 |
comparison
equal
deleted
inserted
replaced
261:0cc297329a6a | 262:dc9216fc0c0f |
---|---|
4 | 4 |
5 function! gutentags#chdir(path) | 5 function! gutentags#chdir(path) |
6 if has('nvim') | 6 if has('nvim') |
7 let chdir = haslocaldir() ? 'lcd' : haslocaldir(-1, 0) ? 'tcd' : 'cd' | 7 let chdir = haslocaldir() ? 'lcd' : haslocaldir(-1, 0) ? 'tcd' : 'cd' |
8 else | 8 else |
9 let chdir = haslocaldir() ? 'lcd' : 'cd' | 9 let chdir = haslocaldir() ? ((haslocaldir() == 1) ? 'lcd' : 'tcd') : 'cd' |
10 endif | 10 endif |
11 execute chdir a:path | 11 execute chdir fnameescape(a:path) |
12 endfunction | 12 endfunction |
13 | 13 |
14 " Throw an exception message. | 14 " Throw an exception message. |
15 function! gutentags#throw(message) | 15 function! gutentags#throw(message) |
16 throw "gutentags: " . a:message | 16 throw "gutentags: " . a:message |