diff --git a/autoload/sy.vim b/autoload/sy.vim index 5c608a7..1be8f2c 100644 --- a/autoload/sy.vim +++ b/autoload/sy.vim @@ -95,6 +95,8 @@ function! sy#start() abort call sy#sign#process_diff(diff) let b:sy.id_top = (g:id_top - 1) + + silent doautocmd User Signify endfunction " Function: #stop {{{1 diff --git a/doc/signify.txt b/doc/signify.txt index 405e24e..c2432c6 100644 --- a/doc/signify.txt +++ b/doc/signify.txt @@ -32,6 +32,7 @@ TOC *signify-contents* USAGE .......................... |signify-usage| OPTIONS ........................ |signify-options| COMMANDS ....................... |signify-commands| + AUTOCOMMAND .................... |signify-autocommand| MAPPINGS ....................... |signify-mappings| COLORS ......................... |signify-colors| FAQ ............................ |signify-faq| @@ -402,6 +403,21 @@ a supported VCS, use this command. It will show all tried commands and its output. Errors will be highlighted via |hl-ErrorMsg|. +============================================================================== +AUTOCOMMAND *signify-autocommand* + +If Sy detects changes to a version-controlled file, it will trigger the |User| +autocommand |{event}| with "Signify" as the autocommand |{pat}|. This allows +you to perform actions in response to Sy detecting differences. + +For example, +> + autocmd User Signify call sy#sign#remove_all_signs(bufnr('')) +< +removes all the signs that Sy placed in the current buffer. This may be +useful if your want to use the values from `sy#repo#get_stats()` but do not +want to see the signs. + ============================================================================== MAPPINGS *signify-mappings*