From 8afee6f26694bb3c2cbc2a4ba3acb2ba52a639ef Mon Sep 17 00:00:00 2001 From: Yoshiaki Kawazu Date: Tue, 24 Jan 2012 13:01:25 +0900 Subject: [PATCH] Add backport of fnameescape(). --- autoload/vundle/config.vim | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index ee1e42b..c73bcd0 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -71,19 +71,30 @@ func! s:rtp_add_a() endf func! s:rtp_rm(dir) abort - exec 'set rtp-='.fnameescape(expand(a:dir, 1)) - exec 'set rtp-='.fnameescape(expand(a:dir.'/after', 1)) + exec 'set rtp-='.s:fnameescape(expand(a:dir, 1)) + exec 'set rtp-='.s:fnameescape(expand(a:dir.'/after', 1)) endf func! s:rtp_add(dir) abort - exec 'set rtp^='.fnameescape(expand(a:dir, 1)) - exec 'set rtp+='.fnameescape(expand(a:dir.'/after', 1)) + exec 'set rtp^='.s:fnameescape(expand(a:dir, 1)) + exec 'set rtp+='.s:fnameescape(expand(a:dir.'/after', 1)) endf func! s:expand_path(path) abort return simplify(expand(a:path, 1)) endf +" Backport of fnameescape(). +function! s:fnameescape(string) + if exists('*fnameescape') + return fnameescape(a:string) + elseif a:string ==# '-' + return '\-' + else + return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','') + endif +endfunction + let s:bundle = {} func! s:bundle.path()