From 7e21d414a878e5271d4b26f81dd45cfe0f39522d Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 25 Aug 2021 22:38:47 -0400 Subject: [PATCH] Trigger FugitiveChanged after writing stage buffer I deliberately omitted this event when adding FugitiveChanged, because I figured it made sense for consumers to instead tap into BufWritePost to see which file changed exactly. This would enable, say, vim-gitgutter, to only refresh signs for the file that actually changed, rather than for every file in the repository. In practice, however, vim-gitgutter doesn't even bother with "in the repository", let alone the exact file, opting instead to refresh every loaded buffer. I give up. Resolves: https://github.com/tpope/vim-fugitive/issues/1819 --- autoload/fugitive.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 5a72bf9..f4a0f99 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2752,6 +2752,7 @@ function! fugitive#FileWriteCmd(...) abort if exists('#' . autype . 'WritePost') execute s:DoAutocmd(autype . 'WritePost ' . s:fnameescape(amatch)) endif + exe s:DoAutocmdChanged(dir) return '' else return 'echoerr '.string('fugitive: '.error)