From cce17ad0a02bfc0b86ed8a667113ff3c9ab79d8d Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 13 May 2018 03:24:28 -0400 Subject: [PATCH] [vim] Use CRLF in batchfile for multibyte codepage (#1289) Close #1288 --- plugin/fzf.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 4659f85b..4c876965 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -50,9 +50,9 @@ if s:is_win " Use utf-8 for fzf.vim commands " Return array of shell commands for cmd.exe function! s:wrap_cmds(cmds) - return ['@echo off', 'for /f "tokens=4" %%a in (''chcp'') do set origchcp=%%a', 'chcp 65001 > nul'] + + return map(['@echo off', 'for /f "tokens=4" %%a in (''chcp'') do set origchcp=%%a', 'chcp 65001 > nul'] + \ (type(a:cmds) == type([]) ? a:cmds : [a:cmds]) + - \ ['chcp %origchcp% > nul'] + \ ['chcp %origchcp% > nul'], 'v:val."\r"') endfunction else let s:term_marker = ";#FZF"