mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-11 13:03:45 -05:00
Fix bug in realtime diff of non-current buffer.
This bug meant that a realtime diff of a buffer which wasn't the current one -- which happens during GitGutterAll() -- diffed the staged version of the buffer against the current buffer's contents instead of the buffer's contents.
This commit is contained in:
@@ -25,15 +25,7 @@ function! diff#run_diff(realtime, use_external_grep)
|
||||
let cmd = utility#escape(cmd)
|
||||
|
||||
if a:realtime
|
||||
if &fileformat ==# "dos"
|
||||
let eol = "\r\n"
|
||||
elseif &fileformat ==# "mac"
|
||||
let eol = "\r"
|
||||
else
|
||||
let eol = "\n"
|
||||
endif
|
||||
let buffer_contents = join(getline(1, '$'), eol) . eol
|
||||
let diff = system(utility#command_in_directory_of_file(cmd), buffer_contents)
|
||||
let diff = system(utility#command_in_directory_of_file(cmd), utility#buffer_contents())
|
||||
else
|
||||
let diff = system(utility#command_in_directory_of_file(cmd))
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user