Use a temporary file for buffer for realtime diffs

`git diff` doesn't perform EOL conversion on stdin, causing it to
mistakenly flag every line as having changed when the working tree uses
a different EOL than the blobs. Writing the buffer to a temporary file
and diffing against that avoids this issue.

Fixes #232.
This commit is contained in:
Eli Young
2015-03-03 14:18:37 -08:00
committed by Andy Stewart
parent 06240f3af3
commit 0cb1e41b23
2 changed files with 15 additions and 4 deletions

View File

@@ -47,6 +47,10 @@ function! gitgutter#utility#filename()
return fnamemodify(s:file, ':t')
endfunction
function! gitgutter#utility#extension()
return fnamemodify(s:file, ':e')
endfunction
function! gitgutter#utility#directory_of_file()
return fnamemodify(s:file, ':h')
endfunction