Workaround for PlugUpgrade error on Neovim (#111)
This commit is contained in:
parent
396a534a0a
commit
4b3fbd1592
16
plug.vim
16
plug.vim
|
@ -1268,12 +1268,7 @@ function! s:upgrade()
|
||||||
throw get(s:lines(output), -1, v:shell_error)
|
throw get(s:lines(output), -1, v:shell_error)
|
||||||
endif
|
endif
|
||||||
elseif has('ruby')
|
elseif has('ruby')
|
||||||
ruby << EOF
|
call s:upgrade_using_ruby(new)
|
||||||
require 'open-uri'
|
|
||||||
File.open(VIM::evaluate('new'), 'w') do |f|
|
|
||||||
f << open(VIM::evaluate('s:plug_src')).read
|
|
||||||
end
|
|
||||||
EOF
|
|
||||||
else
|
else
|
||||||
return s:err('curl executable or ruby support not found')
|
return s:err('curl executable or ruby support not found')
|
||||||
endif
|
endif
|
||||||
|
@ -1294,6 +1289,15 @@ EOF
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:upgrade_using_ruby(new)
|
||||||
|
ruby << EOF
|
||||||
|
require 'open-uri'
|
||||||
|
File.open(VIM::evaluate('a:new'), 'w') do |f|
|
||||||
|
f << open(VIM::evaluate('s:plug_src')).read
|
||||||
|
end
|
||||||
|
EOF
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:upgrade_specs()
|
function! s:upgrade_specs()
|
||||||
for spec in values(g:plugs)
|
for spec in values(g:plugs)
|
||||||
let spec.frozen = get(spec, 'frozen', 0)
|
let spec.frozen = get(spec, 'frozen', 0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user