Add BOM support.

This commit is contained in:
nagao_hiroki
2018-03-26 22:12:46 +09:00
parent 37bdd03d17
commit 3724e1c207

View File

@@ -341,6 +341,10 @@ function! s:write_buffer(bufnr, file)
call map(bufcontents, 'iconv(v:val, &encoding, "'.fenc.'")')
endif
if getbufvar(a:bufnr, '&bomb')
let bufcontents[0]=''.bufcontents[0]
endif
call writefile(bufcontents, a:file)
endfunction