commit a965916ed40205715c12b4f4e9c8ea5ce2b147e3
parent 73404077ab83ff7ea6f29181e439ba758779c5b8
Author: Janis Pagel <janis.pagel@ims.uni-stuttgart.de>
Date: Wed, 29 Jan 2020 14:57:56 +0100
Update plugin manager
Diffstat:
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/vim/autoload/plug.vim b/vim/autoload/plug.vim
@@ -184,8 +184,8 @@ function! s:define_commands()
endif
if !has('nvim')
\ && (has('win32') || has('win32unix'))
- \ && (!has('multi_byte') || !has('iconv'))
- return s:err('Vim needs +iconv, +multi_byte features on Windows to run shell commands.')
+ \ && !has('multi_byte')
+ return s:err('Vim needs +multi_byte feature on Windows to run shell commands. Enable +iconv for best results.')
endif
command! -nargs=* -bar -bang -complete=customlist,s:names PlugInstall call s:install(<bang>0, [<f-args>])
command! -nargs=* -bar -bang -complete=customlist,s:names PlugUpdate call s:update(<bang>0, [<f-args>])
@@ -400,14 +400,19 @@ if s:is_win
endfunction
" Copied from fzf
- let s:codepage = libcallnr('kernel32.dll', 'GetACP', 0)
function! s:wrap_cmds(cmds)
- return map([
+ let cmds = [
\ '@echo off',
\ 'setlocal enabledelayedexpansion']
\ + (type(a:cmds) == type([]) ? a:cmds : [a:cmds])
- \ + ['endlocal'],
- \ printf('iconv(v:val."\r", "%s", "cp%d")', &encoding, s:codepage))
+ \ + ['endlocal']
+ if has('iconv')
+ if !exists('s:codepage')
+ let s:codepage = libcallnr('kernel32.dll', 'GetACP', 0)
+ endif
+ return map(cmds, printf('iconv(v:val."\r", "%s", "cp%d")', &encoding, s:codepage))
+ endif
+ return map(cmds, 'v:val."\r"')
endfunction
function! s:batchfile(cmd)
@@ -1333,9 +1338,10 @@ function! s:bar()
endfunction
function! s:logpos(name)
- for i in range(4, line('$'))
+ let max = line('$')
+ for i in range(4, max > 4 ? max : 4)
if getline(i) =~# '^[-+x*] '.a:name.':'
- for j in range(i + 1, line('$'))
+ for j in range(i + 1, max > 5 ? max : 5)
if getline(j) !~ '^ '
return [i, j - 1]
endif