From 206ec87a39526f9fa424aefb8c84ec09c8cfe76b Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Thu, 9 Feb 2017 21:11:54 +0100 Subject: [PATCH] update plug --- config/nvim/autoload/plug.vim | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/config/nvim/autoload/plug.vim b/config/nvim/autoload/plug.vim index b245aa7..f7564ea 100644 --- a/config/nvim/autoload/plug.vim +++ b/config/nvim/autoload/plug.vim @@ -61,7 +61,7 @@ " More information: https://github.com/junegunn/vim-plug " " -" Copyright (c) 2016 Junegunn Choi +" Copyright (c) 2017 Junegunn Choi " " MIT License " @@ -426,7 +426,10 @@ function! s:dobufread(names) let path = s:rtp(g:plugs[name]).'/**' for dir in ['ftdetect', 'ftplugin'] if len(finddir(dir, path)) - return s:doautocmd('BufRead') + if exists('#BufRead') + doautocmd BufRead + endif + return endif endfor endfor @@ -919,7 +922,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 +1024,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 @@ -1181,7 +1185,7 @@ function! s:spawn(name, cmd, opts) \ 'Invalid arguments (or job table is full)'] endif elseif s:vim8 - let jid = job_start(argv, { + let jid = job_start(s:is_win ? join(argv, ' ') : argv, { \ 'out_cb': function('s:job_cb', ['s:job_out_cb', job]), \ 'exit_cb': function('s:job_cb', ['s:job_exit_cb', job]), \ 'out_mode': 'raw' @@ -2288,7 +2292,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