# HG changeset patch # User zegervdv # Date 1423509936 -3600 # Node ID 6f3eb83613bf1d519b6f34a0c99785bec6127c5a # Parent 639222e1ab7b70f69997cf2e06e19b1a55feefc4 Update vimplug diff -r 639222e1ab7b -r 6f3eb83613bf .gitignore --- a/.gitignore Sat Feb 07 22:12:55 2015 +0100 +++ b/.gitignore Mon Feb 09 20:25:36 2015 +0100 @@ -1,3 +1,4 @@ vimwiki_html *.vim.lock vim/thesaurus/ +*.vim.old diff -r 639222e1ab7b -r 6f3eb83613bf vim/autoload/plug.vim --- a/vim/autoload/plug.vim Sat Feb 07 22:12:55 2015 +0100 +++ b/vim/autoload/plug.vim Mon Feb 09 20:25:36 2015 +0100 @@ -736,7 +736,7 @@ catch let lines = getline(4, '$') let printed = {} - silent 4,$d _ + silent! 4,$d _ for line in lines let name = s:extract_name(line, '.', '') if empty(name) || !has_key(printed, name) @@ -777,7 +777,7 @@ for [name, j] in items(s:jobs) silent! call jobstop(j.jobid) if j.new - call system('rm -rf ' . s:shellesc(g:plugs[name].dir)) + call s:system('rm -rf ' . s:shellesc(g:plugs[name].dir)) endif endfor let s:jobs = {} @@ -914,6 +914,7 @@ let spec = remove(s:update.todo, name) let pull = s:update.pull let new = !isdirectory(spec.dir) + let prog = s:nvim ? '--progress' : '' call s:log(new ? '+' : '*', name, pull ? 'Updating ...' : 'Installing ...') redraw @@ -923,8 +924,8 @@ if valid if pull call s:spawn(name, - \ printf('(git fetch --progress 2>&1 && git checkout -q %s 2>&1 && git merge --ff-only origin/%s 2>&1 && git submodule update --init --recursive 2>&1)', - \ s:shellesc(spec.branch), s:shellesc(spec.branch)), { 'dir': spec.dir }) + \ printf('(git fetch %s 2>&1 && git checkout -q %s 2>&1 && git merge --ff-only origin/%s 2>&1 && git submodule update --init --recursive 2>&1)', + \ prog, s:shellesc(spec.branch), s:shellesc(spec.branch)), { 'dir': spec.dir }) else let s:jobs[name] = { 'running': 0, 'result': 'Already installed', 'error': 0 } endif @@ -933,7 +934,8 @@ endif else call s:spawn(name, - \ printf('git clone --progress --recursive %s -b %s %s 2>&1', + \ printf('git clone %s --recursive %s -b %s %s 2>&1', + \ prog, \ s:shellesc(spec.uri), \ s:shellesc(spec.branch), \ s:shellesc(s:trim(spec.dir))), { 'new': 1 }) @@ -1191,8 +1193,16 @@ endfunction function! s:system(cmd, ...) - let cmd = a:0 > 0 ? s:with_cd(a:cmd, a:1) : a:cmd - return system(s:is_win ? '('.cmd.')' : cmd) + try + let sh = &shell + if !s:is_win + set shell=sh + endif + let cmd = a:0 > 0 ? s:with_cd(a:cmd, a:1) : a:cmd + return system(s:is_win ? '('.cmd.')' : cmd) + finally + let &shell = sh + endtry endfunction function! s:system_chomp(...) @@ -1252,6 +1262,7 @@ let allowed = {} for dir in dirs + let allowed[s:dirpath(fnamemodify(dir, ':h:h'))] = 1 let allowed[dir] = 1 for child in s:glob_dir(dir) let allowed[child] = 1 @@ -1280,7 +1291,7 @@ if yes for dir in todo if isdirectory(dir) - call system((s:is_win ? 'rmdir /S /Q ' : 'rm -rf ') . s:shellesc(dir)) + call s:system((s:is_win ? 'rmdir /S /Q ' : 'rm -rf ') . s:shellesc(dir)) endif endfor call append(line('$'), 'Removed.') @@ -1297,7 +1308,7 @@ redraw try if executable('curl') - let output = system(printf('curl -fLo %s %s', s:shellesc(new), s:plug_src)) + let output = s:system(printf('curl -fLo %s %s', s:shellesc(new), s:plug_src)) if v:shell_error throw get(s:lines(output), -1, v:shell_error) endif @@ -1510,7 +1521,7 @@ \ ['@echo off', ':: Generated by vim-plug', ':: '.strftime("%c"), '', \ ':: Make sure to PlugUpdate first', '', 'set PLUG_HOME='.s:esc(home)]] : \ ['sh', '$PLUG_HOME', - \ ['#!/bin/bash', '# Generated by vim-plug', '# '.strftime("%c"), '', + \ ['#!/bin/sh', '# Generated by vim-plug', '# '.strftime("%c"), '', \ 'vim +PlugUpdate +qa', '', 'PLUG_HOME='.s:esc(home)]] call s:prepare() @@ -1535,7 +1546,7 @@ if a:0 > 0 let fn = s:esc(expand(a:1)) call writefile(getline(1, '$'), fn) - if !s:is_win | call system('chmod +x ' . fn) | endif + if !s:is_win | call s:system('chmod +x ' . fn) | endif echo 'Saved to '.a:1 silent execute 'e' fn endif