changeset 242:0994a5f99432

Update vimplug
author zegervdv <zegervdv@me.com>
date Tue, 17 Feb 2015 20:35:15 +0100
parents 5fb4bf06d46d
children 367fd20ecfbc
files vim/autoload/plug.vim
diffstat 1 files changed, 21 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/vim/autoload/plug.vim	Mon Feb 16 10:54:29 2015 +0100
+++ b/vim/autoload/plug.vim	Tue Feb 17 20:35:15 2015 +0100
@@ -73,7 +73,7 @@
 let s:plug_buf = get(s:, 'plug_buf', -1)
 let s:mac_gui = has('gui_macvim') && has('gui_running')
 let s:is_win = has('win32') || has('win64')
-let s:ruby = has('ruby') && has('patch-7.2.374')
+let s:ruby = has('ruby') && (v:version >= 703 || v:version == 702 && has('patch374'))
 let s:nvim = has('nvim') && !s:is_win
 let s:me = resolve(expand('<sfile>:p'))
 let s:base_spec = { 'branch': 'master', 'frozen': 0 }
@@ -115,7 +115,7 @@
   command! -nargs=* -bar -bang -complete=customlist,s:names PlugInstall call s:install('<bang>' == '!', [<f-args>])
   command! -nargs=* -bar -bang -complete=customlist,s:names PlugUpdate  call s:update('<bang>' == '!', [<f-args>])
   command! -nargs=0 -bar -bang PlugClean call s:clean('<bang>' == '!')
-  command! -nargs=0 -bar PlugUpgrade if s:upgrade() | execute 'source' s:me | endif
+  command! -nargs=0 -bar PlugUpgrade if s:upgrade() | execute 'source' s:esc(s:me) | endif
   command! -nargs=0 -bar PlugStatus  call s:status()
   command! -nargs=0 -bar PlugDiff    call s:diff()
   command! -nargs=? -bar PlugSnapshot call s:snapshot(<f-args>)
@@ -132,7 +132,7 @@
 function! s:source(from, ...)
   for pattern in a:000
     for vim in s:lines(globpath(a:from, pattern))
-      execute 'source' vim
+      execute 'source' s:esc(vim)
     endfor
   endfor
 endfunction
@@ -327,9 +327,9 @@
   let s:middle = get(s:, 'middle', &rtp)
   let rtps     = map(s:loaded_names(), 's:rtp(g:plugs[v:val])')
   let afters   = filter(map(copy(rtps), 'globpath(v:val, "after")'), 'isdirectory(v:val)')
-  let rtp      = join(map(rtps, 's:escrtp(v:val)'), ',')
+  let rtp      = join(map(rtps, 'escape(v:val, ",")'), ',')
                  \ . ','.s:middle.','
-                 \ . join(map(afters, 's:escrtp(v:val)'), ',')
+                 \ . join(map(afters, 'escape(v:val, ",")'), ',')
   let &rtp     = substitute(substitute(rtp, ',,*', ',', 'g'), '^,\|,$', '', 'g')
   let s:prtp   = &rtp
 
@@ -718,6 +718,15 @@
     return
   endif
 
+  if !s:is_win && s:git_version_requirement(2, 3)
+    let s:git_terminal_prompt = exists('$GIT_TERMINAL_PROMPT') ? $GIT_TERMINAL_PROMPT : ''
+    let $GIT_TERMINAL_PROMPT = 0
+    for plug in values(todo)
+      let plug.uri = substitute(plug.uri,
+            \ '^https://git::@github\.com', 'https://github.com', '')
+    endfor
+  endif
+
   if !isdirectory(g:plug_home)
     try
       call mkdir(g:plug_home, 'p')
@@ -777,6 +786,9 @@
 endfunction
 
 function! s:update_finish()
+  if exists('s:git_terminal_prompt')
+    let $GIT_TERMINAL_PROMPT = s:git_terminal_prompt
+  endif
   if s:switch_in()
     call s:do(s:update.pull, s:update.force, filter(copy(s:update.all), 'has_key(v:val, "do")'))
     call s:finish(s:update.pull)
@@ -1562,11 +1574,12 @@
   endfor
 
   if a:0 > 0
-    let fn = s:esc(expand(a:1))
+    let fn = expand(a:1)
+    let fne = s:esc(fn)
     call writefile(getline(1, '$'), fn)
-    if !s:is_win | call s:system('chmod +x ' . fn) | endif
+    if !s:is_win | call s:system('chmod +x ' . fne) | endif
     echo 'Saved to '.a:1
-    silent execute 'e' fn
+    silent execute 'e' fne
   endif
 endfunction