summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-01-07 02:11:47 -0500
committerJunegunn Choi <junegunn.c@gmail.com>2020-01-07 16:11:47 +0900
commite21b001116d5eb0b4ec799d73c11277d14a1ca61 (patch)
treea0f4a9761a21677786fdfa1bf0451044ce2baa53 /plugin
parent577024f1e9bfc98f48e7c5bead445bc9d7dfc3c5 (diff)
downloadfzf-e21b001116d5eb0b4ec799d73c11277d14a1ca61.tar.gz
[vim] Use iconv only if +iconv is enabled (#1813)
Diffstat (limited to 'plugin')
-rw-r--r--plugin/fzf.vim7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim
index 0bbeaff9..21b7d66b 100644
--- a/plugin/fzf.vim
+++ b/plugin/fzf.vim
@@ -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)