Skip to content
Myr

[vim/windows] Fix chcp parsing for the current codepage

Before adoption: this commit came in with the history the project adopted, so no landing records it.

https://github.com/junegunn/vim-plug/pull/888

authored by Junegunn Choi · committed by Junegunn Choi · parent ab11b74 · Browse files · 1 file+9 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • https: //github.com/junegunn/vim-plug/pull/888

Diff stats

1 file+9 added−3 removed

  • other:+9 added−3 removed

1 file+9 added−3 removed

modified:plugin/fzf.vim+9 added-3 removed
48 unmodified lines
4950 " Use utf-8 for fzf.vim commands51 " Return array of shell commands for cmd.exe52 function! s:wrap_cmds(cmds)53 return map(['@echo off', 'setlocal enabledelayedexpansion', 'for /f "delims=: tokens=2" %%a in (''chcp'') do set origchcp=%%a', 'set origchcp=!origchcp: =!', 'chcp 65001 > nul'] +54 \ (type(a:cmds) == type([]) ? a:cmds : [a:cmds]) +55 \ ['chcp !origchcp! > nul', 'setlocal disabledelayedexpansion'], 'v:val."\r"')53 return map([54 \ '@echo off',55 \ 'setlocal enabledelayedexpansion',56 \ 'for /f "tokens=*" %%a in (''chcp'') do for %%b in (%%a) do set origchcp=%%b',57 \ 'chcp 65001 > nul'58 \ ]59 \ + (type(a:cmds) == type([]) ? a:cmds : [a:cmds])60 \ + ['chcp !origchcp! > nul', 'endlocal'],61 \ 'v:val."\r"')62 endfunction63else64 let s:term_marker = ";#FZF"65
754 unmodified lines