From e08860fe90a3134a1330633956e8dd3baa6e58ba Mon Sep 17 00:00:00 2001 From: Patrick Auernig Date: Sat, 7 Jan 2017 19:29:08 +0100 Subject: [PATCH] update plug.vim --- autoload/plug.vim | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/autoload/plug.vim b/autoload/plug.vim index 9165956..95d8eab 100644 --- a/autoload/plug.vim +++ b/autoload/plug.vim @@ -18,7 +18,7 @@ " " Any valid git URL is allowed " Plug 'https://github.com/junegunn/vim-github-dashboard.git' " -" " Group dependencies, vim-snippets depends on ultisnips +" " Multiple Plug commands can be written in a single line using | separators " Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' " " " On-demand loading @@ -40,7 +40,7 @@ " " Unmanaged plugin (manually installed and updated) " Plug '~/my-prototype-plugin' " -" " Add plugins to &runtimepath +" " Initialize plugin system " call plug#end() " " Then reload .vimrc and :PlugInstall to install plugins. @@ -61,7 +61,7 @@ " More information: https://github.com/junegunn/vim-plug " " -" Copyright (c) 2016 Junegunn Choi +" Copyright (c) 2017 Junegunn Choi " " MIT License " @@ -919,7 +919,8 @@ function! s:check_ruby() endfunction function! s:update_impl(pull, force, args) abort - let args = copy(a:args) + let sync = index(a:args, '--sync') >= 0 || has('vim_starting') + let args = filter(copy(a:args), 'v:val != "--sync"') let threads = (len(args) > 0 && args[-1] =~ '^[1-9][0-9]*$') ? \ remove(args, -1) : get(g:, 'plug_threads', 16) @@ -1020,7 +1021,7 @@ function! s:update_impl(pull, force, args) abort endtry else call s:update_vim() - while use_job && has('vim_starting') + while use_job && sync sleep 100m if s:update.fin break @@ -2288,7 +2289,12 @@ function! s:preview_commit() wincmd P endif setlocal previewwindow filetype=git buftype=nofile nobuflisted modifiable - execute 'silent %!cd' s:shellesc(g:plugs[name].dir) '&& git show --no-color --pretty=medium' sha + try + let [sh, shrd] = s:chsh(1) + execute 'silent %!cd' s:shellesc(g:plugs[name].dir) '&& git show --no-color --pretty=medium' sha + finally + let [&shell, &shellredir] = [sh, shrd] + endtry setlocal nomodifiable nnoremap q :q wincmd p