mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
Fix write_buffer() to not add extra line for dos fileformat
This commit is contained in:
@@ -381,14 +381,14 @@ function! s:write_buffer(bufnr, file)
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if getbufvar(a:bufnr, '&endofline')
|
|
||||||
call add(bufcontents, '')
|
|
||||||
endif
|
|
||||||
|
|
||||||
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, '&endofline')
|
||||||
|
call add(bufcontents, '')
|
||||||
|
endif
|
||||||
|
|
||||||
let fenc = getbufvar(a:bufnr, '&fileencoding')
|
let fenc = getbufvar(a:bufnr, '&fileencoding')
|
||||||
if fenc !=# &encoding
|
if fenc !=# &encoding
|
||||||
call map(bufcontents, 'iconv(v:val, &encoding, "'.fenc.'")')
|
call map(bufcontents, 'iconv(v:val, &encoding, "'.fenc.'")')
|
||||||
|
|||||||
Reference in New Issue
Block a user