|
|
@@ -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
|
|
|
@@ -817,6 +820,10 @@ function! s:do(pull, force, todo)
|
|
|
let type = type(spec.do)
|
|
|
if type == s:TYPE.string
|
|
|
if spec.do[0] == ':'
|
|
|
+ if !get(s:loaded, name, 0)
|
|
|
+ let s:loaded[name] = 1
|
|
|
+ call s:reorg_rtp()
|
|
|
+ endif
|
|
|
call s:load_plugin(spec)
|
|
|
try
|
|
|
execute spec.do[1:]
|
|
|
@@ -919,7 +926,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 +1028,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 +1189,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'
|
|
|
@@ -1764,6 +1772,7 @@ function! s:update_ruby()
|
|
|
tries = VIM::evaluate('get(g:, "plug_retries", 2)') + 1
|
|
|
nthr = VIM::evaluate('s:update.threads').to_i
|
|
|
maxy = VIM::evaluate('winheight(".")').to_i
|
|
|
+ vim7 = VIM::evaluate('v:version').to_i <= 703 && RUBY_PLATFORM =~ /darwin/
|
|
|
cd = iswin ? 'cd /d' : 'cd'
|
|
|
tot = VIM::evaluate('len(s:update.todo)') || 0
|
|
|
bar = ''
|
|
|
@@ -1853,11 +1862,17 @@ function! s:update_ruby()
|
|
|
main = Thread.current
|
|
|
threads = []
|
|
|
watcher = Thread.new {
|
|
|
- require 'io/console' # >= Ruby 1.9
|
|
|
- nil until IO.console.getch == 3.chr
|
|
|
+ if vim7
|
|
|
+ while VIM::evaluate('getchar(1)')
|
|
|
+ sleep 0.1
|
|
|
+ end
|
|
|
+ else
|
|
|
+ require 'io/console' # >= Ruby 1.9
|
|
|
+ nil until IO.console.getch == 3.chr
|
|
|
+ end
|
|
|
mtx.synchronize do
|
|
|
running = false
|
|
|
- threads.each { |t| t.raise Interrupt }
|
|
|
+ threads.each { |t| t.raise Interrupt } unless vim7
|
|
|
end
|
|
|
threads.each { |t| t.join rescue nil }
|
|
|
main.kill
|
|
|
@@ -2288,7 +2303,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 <silent> <buffer> q :q<cr>
|
|
|
wincmd p
|