mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-11 21:03:53 -05:00
Avoid unnecessary diff.
This commit is contained in:
@@ -154,7 +154,7 @@ function! gitgutter#stage_hunk()
|
||||
if gitgutter#utility#is_active()
|
||||
" Ensure the working copy of the file is up to date.
|
||||
" It doesn't make sense to stage a hunk otherwise.
|
||||
silent write
|
||||
noautocmd silent write
|
||||
|
||||
if empty(gitgutter#hunk#current_hunk())
|
||||
call gitgutter#utility#warn('cursor is not in a hunk')
|
||||
@@ -174,7 +174,7 @@ function! gitgutter#revert_hunk()
|
||||
if gitgutter#utility#is_active()
|
||||
" Ensure the working copy of the file is up to date.
|
||||
" It doesn't make sense to stage a hunk otherwise.
|
||||
silent write
|
||||
noautocmd silent write
|
||||
|
||||
if empty(gitgutter#hunk#current_hunk())
|
||||
call gitgutter#utility#warn('cursor is not in a hunk')
|
||||
@@ -192,7 +192,7 @@ endfunction
|
||||
|
||||
function! gitgutter#preview_hunk()
|
||||
if gitgutter#utility#is_active()
|
||||
silent write
|
||||
noautocmd silent write
|
||||
|
||||
if empty(gitgutter#hunk#current_hunk())
|
||||
call gitgutter#utility#warn('cursor is not in a hunk')
|
||||
|
||||
Reference in New Issue
Block a user