mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-10 12:33:47 -05:00
@@ -374,8 +374,10 @@ endfunction
|
||||
function! s:write_buffer(bufnr, file)
|
||||
let bufcontents = getbufline(a:bufnr, 1, '$')
|
||||
|
||||
" Special case: empty buffer; do not write an empty line in this case.
|
||||
if len(bufcontents) > 1 || bufcontents != ['']
|
||||
if bufcontents == [''] && line2byte(1) == -1
|
||||
" Special case: empty buffer; do not write an empty line in this case.
|
||||
" A nearly empty buffer of only a newline has line2byte(1) == 1.
|
||||
else
|
||||
if getbufvar(a:bufnr, '&endofline')
|
||||
\ || (!getbufvar(a:bufnr, '&binary')
|
||||
\ && (!exists('+fixendofline') || getbufvar(a:bufnr, '&fixendofline')))
|
||||
|
||||
Reference in New Issue
Block a user