mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-09 03:53:47 -05:00
Fix wrong signs when &encoding and &fileencoding differ
This commit is contained in:
@@ -334,6 +334,9 @@ function! s:write_buffer(bufnr, file)
|
|||||||
if getbufvar(a:bufnr, '&fileformat') ==# 'dos'
|
if getbufvar(a:bufnr, '&fileformat') ==# 'dos'
|
||||||
call map(bufcontents, 'v:val."\r"')
|
call map(bufcontents, 'v:val."\r"')
|
||||||
endif
|
endif
|
||||||
|
if getbufvar(a:bufnr, '&fileencoding') !=# &encoding
|
||||||
|
call map(bufcontents, 'iconv(v:val, &encoding, getbufvar(a:bufnr, "&fileencoding"))')
|
||||||
|
endif
|
||||||
call writefile(bufcontents, a:file)
|
call writefile(bufcontents, a:file)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user