Fix wrong signs when &encoding and &fileencoding differ

This commit is contained in:
Bakudankun
2018-03-06 10:41:21 +09:00
committed by Andy Stewart
parent 2f736d58b4
commit 3b2461b2fb

View File

@@ -334,6 +334,9 @@ function! s:write_buffer(bufnr, file)
if getbufvar(a:bufnr, '&fileformat') ==# 'dos'
call map(bufcontents, 'v:val."\r"')
endif
if getbufvar(a:bufnr, '&fileencoding') !=# &encoding
call map(bufcontents, 'iconv(v:val, &encoding, getbufvar(a:bufnr, "&fileencoding"))')
endif
call writefile(bufcontents, a:file)
endfunction