Skip to content
This repository has been archived by the owner on Apr 10, 2020. It is now read-only.

Commit

Permalink
Upgrade vimplug
Browse files Browse the repository at this point in the history
  • Loading branch information
charlax committed Oct 23, 2019
1 parent 57a4a37 commit 2c6b7cd
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions autoload/plug.vim
Expand Up @@ -334,11 +334,11 @@ function! s:progress_opt(base)
\ s:git_version_requirement(1, 7, 1) ? '--progress' : ''
endfunction

if s:is_win
function! s:rtp(spec)
return s:path(a:spec.dir . get(a:spec, 'rtp', ''))
endfunction
function! s:rtp(spec)
return s:path(a:spec.dir . get(a:spec, 'rtp', ''))
endfunction

if s:is_win
function! s:path(path)
return s:trim(substitute(a:path, '/', '\', 'g'))
endfunction
Expand All @@ -353,14 +353,16 @@ if s:is_win

" Copied from fzf
function! s:wrap_cmds(cmds)
let use_chcp = executable('sed')
return map([
\ '@echo off',
\ 'setlocal enabledelayedexpansion',
\ 'for /f "tokens=*" %%a in (''chcp'') do for %%b in (%%a) do set origchcp=%%b',
\ 'chcp 65001 > nul'
\ ]
\ 'setlocal enabledelayedexpansion']
\ + (use_chcp ? [
\ 'for /f "usebackq" %%a in (`chcp ^| sed "s/[^0-9]//gp"`) do set origchcp=%%a',
\ 'chcp 65001 > nul'] : [])
\ + (type(a:cmds) == type([]) ? a:cmds : [a:cmds])
\ + ['chcp !origchcp! > nul', 'endlocal'],
\ + (use_chcp ? ['chcp !origchcp! > nul'] : [])
\ + ['endlocal'],
\ 'v:val."\r"')
endfunction

Expand All @@ -374,10 +376,6 @@ if s:is_win
return [batchfile, cmd]
endfunction
else
function! s:rtp(spec)
return s:dirpath(a:spec.dir . get(a:spec, 'rtp', ''))
endfunction

function! s:path(path)
return s:trim(a:path)
endfunction
Expand Down Expand Up @@ -1034,7 +1032,7 @@ function! s:update_impl(pull, force, args) abort
let s:clone_opt = get(g:, 'plug_shallow', 1) ?
\ '--depth 1' . (s:git_version_requirement(1, 7, 10) ? ' --no-single-branch' : '') : ''

if has('win32unix')
if has('win32unix') || has('wsl')
let s:clone_opt .= ' -c core.eol=lf -c core.autocrlf=input'
endif

Expand Down

0 comments on commit 2c6b7cd

Please sign in to comment.