mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
Revert to non-binary writefile() for writing buffer.
The previous commit switched use of writefile() to binary mode so that we could prevent a newline being added to a completely empty buffer. Evidently, however, binary mode has side effects (see #567) so this commit returns to non-binary mode - with a simpler fix for completely empty files. Unfortunately this implementation does not work for noeol files - see the failing test - because writefile() does not take account of 'nofixeol' (unlike :write). This is suboptimal but acceptable because noeol files are not be encountered often. See #567.
This commit is contained in:
@@ -669,7 +669,7 @@ function Test_empty_file()
|
||||
|
||||
" 1 line file without newline
|
||||
" Vim will force a newline unless we tell it not to.
|
||||
call system('echo -n "a" > oneline.txt && git add oneline.txt')
|
||||
call system('echo -n a > oneline.txt && git add oneline.txt')
|
||||
set noeol nofixeol
|
||||
edit! oneline.txt
|
||||
|
||||
|
||||
Reference in New Issue
Block a user