mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
Make realtime diff use git-diff.
The only reason the realtime diff used `diff` instead of `git-diff` previously was that I couldn't figure out how to do it in a way that worked on Windows as well as Unix.
This commit is contained in:
@@ -10,10 +10,14 @@ function! gitgutter#diff#run_diff(realtime, use_external_grep, lines_of_context)
|
||||
if a:realtime
|
||||
let blob_name = ':'.gitgutter#utility#shellescape(gitgutter#utility#file_relative_to_repo_root())
|
||||
let blob_file = tempname()
|
||||
let cmd .= 'git show ' . blob_name . ' > ' . blob_file .
|
||||
\ ' && diff -U'.a:lines_of_context.' ' . g:gitgutter_diff_args . ' ' . blob_file . ' - '
|
||||
let cmd .= 'git show '.blob_name.' > '.blob_file.' && '
|
||||
endif
|
||||
|
||||
let cmd .= 'git diff --no-ext-diff --no-color -U'.a:lines_of_context.' '.g:gitgutter_diff_args.' '
|
||||
if a:realtime
|
||||
let cmd .= '-- '.blob_file.' - '
|
||||
else
|
||||
let cmd .= 'git diff --no-ext-diff --no-color -U'.a:lines_of_context.' ' . g:gitgutter_diff_args . ' ' . gitgutter#utility#shellescape(gitgutter#utility#filename())
|
||||
let cmd .= gitgutter#utility#shellescape(gitgutter#utility#filename())
|
||||
endif
|
||||
|
||||
if a:use_external_grep && s:grep_available
|
||||
|
||||
Reference in New Issue
Block a user