Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Support :Vedit on versions prior to 7.1.299

  • Loading branch information...
commit ab64b4ddd0c184a528780b498a0b0a5b40248f7c 1 parent 00ce061
@tpope authored
Showing with 13 additions and 2 deletions.
  1. +13 −2 autoload/pathogen.vim
View
15 autoload/pathogen.vim
@@ -180,6 +180,17 @@ function! pathogen#runtime_findfile(file,count) "{{{1
return fnamemodify(findfile(a:file,rtp,a:count),':p')
endfunction " }}}1
+" Backport of fnameescape().
+function! pathogen#fnameescape(string) " {{{1
+ if exists('*fnameescape')
+ return fnameescape(a:string)
+ elseif a:string ==# '-'
+ return '\-'
+ else
+ return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','')
+ endif
+endfunction " }}}1
+
function! s:find(count,cmd,file,lcd) " {{{1
let rtp = pathogen#join(1,pathogen#split(&runtimepath))
let file = pathogen#runtime_findfile(a:file,a:count)
@@ -188,9 +199,9 @@ function! s:find(count,cmd,file,lcd) " {{{1
elseif a:lcd
let path = file[0:-strlen(a:file)-2]
execute 'lcd `=path`'
- return a:cmd.' '.fnameescape(a:file)
+ return a:cmd.' '.pathogen#fnameescape(a:file)
else
- return a:cmd.' '.fnameescape(file)
+ return a:cmd.' '.pathogen#fnameescape(file)
endif
endfunction " }}}1
Please sign in to comment.
Something went wrong with that request. Please try again.