mirror of
https://github.com/junegunn/fzf.git
synced 2026-10-28 08:05:53 +00:00
[vim] Use iconv only if +iconv is enabled (#1813)
This commit is contained in:
1 parent
577024f1e9
commit
e21b001116
1 file changed
+6
-1
+6
-1
@@ -49,8 +49,13 @@ if s:is_win
|
||||
|
||||
" Use utf-8 for fzf.vim commands
|
||||
" Return array of shell commands for cmd.exe
|
||||
let s:codepage = libcallnr('kernel32.dll', 'GetACP', 0)
|
||||
function! s:enc_to_cp(str)
|
||||
if !has('iconv')
|
||||
return a:str
|
||||
endif
|
||||
if !exists('s:codepage')
|
||||
let s:codepage = libcallnr('kernel32.dll', 'GetACP', 0)
|
||||
endif
|
||||
return iconv(a:str, &encoding, 'cp'.s:codepage)
|
||||
endfunction
|
||||
function! s:wrap_cmds(cmds)
|
||||
|
||||
Reference in new issue
Block a user