Improve GitGutter User autocommand: context/unsilent

This provides `g:gitgutter_hook_context` during the hook's execution and
removes the `:silent`, but uses `exists()` instead.

The bufnr might be necessary to know in the User autocommand, e.g. to
clear some cache.
Not using`:silent` is good practice in general to not hide (wanted)
output and errors etc.
This commit is contained in:
Daniel Hahler
2018-02-20 22:11:10 +01:00
committed by Andy Stewart
parent 4692457ae2
commit a046b5ace1
2 changed files with 7 additions and 1 deletions

View File

@@ -159,6 +159,8 @@ event GitGutter. You can listen for this event, for example:
>
autocmd User GitGutter call updateMyStatusLine()
<
A dictionary `g:gitgutter_hook_context` is made available during its execution,
which contains an entry `bufnr` that contains the buffer number being updated.
===============================================================================