Fix write_buffer() to not add extra line for dos fileformat

This commit is contained in:
Andy Stewart
2019-10-15 10:14:10 +01:00
parent ed978c40eb
commit 5c73edb3c2

View File

@@ -381,14 +381,14 @@ function! s:write_buffer(bufnr, file)
return
endif
if getbufvar(a:bufnr, '&endofline')
call add(bufcontents, '')
endif
if getbufvar(a:bufnr, '&fileformat') ==# 'dos'
call map(bufcontents, 'v:val."\r"')
endif
if getbufvar(a:bufnr, '&endofline')
call add(bufcontents, '')
endif
let fenc = getbufvar(a:bufnr, '&fileencoding')
if fenc !=# &encoding
call map(bufcontents, 'iconv(v:val, &encoding, "'.fenc.'")')