From ea87e05e6fcbbaece63aac4e9c1c23adb881b86c Mon Sep 17 00:00:00 2001 From: itouen <45067835+itouen@users.noreply.github.com> Date: Sat, 17 Nov 2018 01:23:24 +0900 Subject: [PATCH] SignifyDiff: convert encoding based on fileencoding (#278) --- autoload/sy/repo.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/autoload/sy/repo.vim b/autoload/sy/repo.vim index c15213d..6a2bc60 100644 --- a/autoload/sy/repo.vim +++ b/autoload/sy/repo.vim @@ -252,6 +252,7 @@ function! sy#repo#diffmode(do_tab) abort let cmd = s:expand_cmd(vcs, g:signify_vcs_cmds_diffmode) call sy#verbose('SignifyDiff: '. cmd, vcs) let ft = &filetype + let fenc = &fenc if a:do_tab tabedit % endif @@ -260,7 +261,11 @@ function! sy#repo#diffmode(do_tab) abort try execute chdir fnameescape(b:sy.info.dir) leftabove vnew - silent put =system(cmd) + if has('iconv') + silent put =iconv(system(cmd), fenc, &enc) + else + silent put =system(cmd) + endif finally execute chdir fnameescape(cwd) endtry