update plug

This commit is contained in:
Felix Van der Jeugt 2017-02-09 21:11:54 +01:00
parent 5a433c5339
commit 206ec87a39
No known key found for this signature in database
GPG Key ID: 58B209295023754D

View File

@ -61,7 +61,7 @@
" More information: https://github.com/junegunn/vim-plug " More information: https://github.com/junegunn/vim-plug
" "
" "
" Copyright (c) 2016 Junegunn Choi " Copyright (c) 2017 Junegunn Choi
" "
" MIT License " MIT License
" "
@ -426,7 +426,10 @@ function! s:dobufread(names)
let path = s:rtp(g:plugs[name]).'/**' let path = s:rtp(g:plugs[name]).'/**'
for dir in ['ftdetect', 'ftplugin'] for dir in ['ftdetect', 'ftplugin']
if len(finddir(dir, path)) if len(finddir(dir, path))
return s:doautocmd('BufRead') if exists('#BufRead')
doautocmd BufRead
endif
return
endif endif
endfor endfor
endfor endfor
@ -919,7 +922,8 @@ function! s:check_ruby()
endfunction endfunction
function! s:update_impl(pull, force, args) abort 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]*$') ? let threads = (len(args) > 0 && args[-1] =~ '^[1-9][0-9]*$') ?
\ remove(args, -1) : get(g:, 'plug_threads', 16) \ remove(args, -1) : get(g:, 'plug_threads', 16)
@ -1020,7 +1024,7 @@ function! s:update_impl(pull, force, args) abort
endtry endtry
else else
call s:update_vim() call s:update_vim()
while use_job && has('vim_starting') while use_job && sync
sleep 100m sleep 100m
if s:update.fin if s:update.fin
break break
@ -1181,7 +1185,7 @@ function! s:spawn(name, cmd, opts)
\ 'Invalid arguments (or job table is full)'] \ 'Invalid arguments (or job table is full)']
endif endif
elseif s:vim8 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]), \ 'out_cb': function('s:job_cb', ['s:job_out_cb', job]),
\ 'exit_cb': function('s:job_cb', ['s:job_exit_cb', job]), \ 'exit_cb': function('s:job_cb', ['s:job_exit_cb', job]),
\ 'out_mode': 'raw' \ 'out_mode': 'raw'
@ -2288,7 +2292,12 @@ function! s:preview_commit()
wincmd P wincmd P
endif endif
setlocal previewwindow filetype=git buftype=nofile nobuflisted modifiable setlocal previewwindow filetype=git buftype=nofile nobuflisted modifiable
try
let [sh, shrd] = s:chsh(1)
execute 'silent %!cd' s:shellesc(g:plugs[name].dir) '&& git show --no-color --pretty=medium' sha 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 setlocal nomodifiable
nnoremap <silent> <buffer> q :q<cr> nnoremap <silent> <buffer> q :q<cr>
wincmd p wincmd p