summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2019-09-29 14:51:38 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2019-09-29 14:53:45 +0900
commitab11b74be4b0c9fac88d95f0f563d0dc0cb06ed3 (patch)
tree4754b1d75eea34e656e248cda574377fb871ecba
parenta5a97be0178c59fb9670d534fce6ffe84cc01f66 (diff)
[vim] Output of chcp was not parsed correctly
By @gh4w and @janlazo See https://github.com/junegunn/vim-plug/commit/68b31a4a66ec945ff299db25a8a6382cd48edf14
-rw-r--r--plugin/fzf.vim4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim
index a138c4fe..6055b245 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 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]) +
- \ ['chcp %origchcp% > nul'], 'v:val."\r"')
+ \ ['chcp !origchcp! > nul', 'setlocal disabledelayedexpansion'], 'v:val."\r"')
endfunction
else
let s:term_marker = ";#FZF"