mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-06-26 10:52:37 +00:00
[vim] Output of chcp was not parsed correctly
By @gh4w and @janlazo
See 68b31a4a66
This commit is contained in:
parent
a5a97be017
commit
ab11b74be4
|
@ -50,9 +50,9 @@ if s:is_win
|
||||||
" Use utf-8 for fzf.vim commands
|
" Use utf-8 for fzf.vim commands
|
||||||
" Return array of shell commands for cmd.exe
|
" Return array of shell commands for cmd.exe
|
||||||
function! s:wrap_cmds(cmds)
|
function! s:wrap_cmds(cmds)
|
||||||
return map(['@echo off', 'for /f "tokens=4" %%a in (''chcp'') do set origchcp=%%a', 'chcp 65001 > nul'] +
|
return map(['@echo off', 'setlocal enabledelayedexpansion', 'for /f "delims=: tokens=2" %%a in (''chcp'') do set origchcp=%%a', 'set origchcp=!origchcp: =!', 'chcp 65001 > nul'] +
|
||||||
\ (type(a:cmds) == type([]) ? a:cmds : [a:cmds]) +
|
\ (type(a:cmds) == type([]) ? a:cmds : [a:cmds]) +
|
||||||
\ ['chcp %origchcp% > nul'], 'v:val."\r"')
|
\ ['chcp !origchcp! > nul', 'setlocal disabledelayedexpansion'], 'v:val."\r"')
|
||||||
endfunction
|
endfunction
|
||||||
else
|
else
|
||||||
let s:term_marker = ";#FZF"
|
let s:term_marker = ";#FZF"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user