mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
@@ -88,6 +88,10 @@ You can jump between hunks with `[c` and `]c`. You can preview, stage, and undo
|
|||||||
|
|
||||||
You cannot unstage a staged hunk.
|
You cannot unstage a staged hunk.
|
||||||
|
|
||||||
|
After updating the signs, the plugin fires the `GitGutter` User autocommand.
|
||||||
|
|
||||||
|
After staging a hunk or part of a hunk, the plugin fires the `GitGutterStage` User autocommand.
|
||||||
|
|
||||||
|
|
||||||
#### Activation
|
#### Activation
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
let s:winid = 0
|
let s:winid = 0
|
||||||
|
let s:nomodeline = (v:version > 703 || (v:version == 703 && has('patch442'))) ? '<nomodeline>' : ''
|
||||||
|
|
||||||
function! gitgutter#hunk#set_hunks(bufnr, hunks) abort
|
function! gitgutter#hunk#set_hunks(bufnr, hunks) abort
|
||||||
call gitgutter#utility#setbufvar(a:bufnr, 'hunks', a:hunks)
|
call gitgutter#utility#setbufvar(a:bufnr, 'hunks', a:hunks)
|
||||||
@@ -274,6 +275,10 @@ function! s:stage(hunk_diff)
|
|||||||
\ diff)
|
\ diff)
|
||||||
if v:shell_error
|
if v:shell_error
|
||||||
call gitgutter#utility#warn('patch does not apply')
|
call gitgutter#utility#warn('patch does not apply')
|
||||||
|
else
|
||||||
|
if exists('#User#GitGutterStage')
|
||||||
|
execute 'doautocmd' s:nomodeline 'User GitGutterStage'
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Refresh gitgutter's view of buffer.
|
" Refresh gitgutter's view of buffer.
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ Commands for folds:~
|
|||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
AUTOCOMMAND *gitgutter-autocommand*
|
AUTOCOMMANDS *gitgutter-autocommands*
|
||||||
|
|
||||||
User GitGutter~
|
User GitGutter~
|
||||||
|
|
||||||
@@ -189,6 +189,10 @@ event GitGutter. You can listen for this event, for example:
|
|||||||
A dictionary `g:gitgutter_hook_context` is made available during its execution,
|
A dictionary `g:gitgutter_hook_context` is made available during its execution,
|
||||||
which contains an entry `bufnr` that contains the buffer number being updated.
|
which contains an entry `bufnr` that contains the buffer number being updated.
|
||||||
|
|
||||||
|
User GitGutterStage~
|
||||||
|
|
||||||
|
After staging a hunk or part of a hunk vim-gitgutter fires a |User| |autocmd|
|
||||||
|
with the event GitGutterStage. Staging always happens in the current buffer.
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
MAPPINGS *gitgutter-mappings*
|
MAPPINGS *gitgutter-mappings*
|
||||||
|
|||||||
Reference in New Issue
Block a user