From 07b60b584ea603693d24a72207de58a446e0b5ec Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Tue, 4 Jun 2019 12:37:59 +0100 Subject: [PATCH] Update signs when file renamed via :saveas Fixes #551. --- autoload/gitgutter.vim | 1 + plugin/gitgutter.vim | 3 +++ 2 files changed, 4 insertions(+) diff --git a/autoload/gitgutter.vim b/autoload/gitgutter.vim index e4a9d6e..cc6f7cf 100644 --- a/autoload/gitgutter.vim +++ b/autoload/gitgutter.vim @@ -173,4 +173,5 @@ function! s:clear(bufnr) call gitgutter#sign#remove_dummy_sign(a:bufnr, 1) call gitgutter#hunk#reset(a:bufnr) call s:reset_tick(a:bufnr) + call gitgutter#utility#setbufvar(a:bufnr, 'path', '') endfunction diff --git a/plugin/gitgutter.vim b/plugin/gitgutter.vim index 1bb27a1..4d82c84 100644 --- a/plugin/gitgutter.vim +++ b/plugin/gitgutter.vim @@ -214,6 +214,9 @@ augroup gitgutter autocmd ShellCmdPost * call gitgutter#all(1) autocmd BufLeave term://* call gitgutter#all(1) + autocmd BufFilePre * GitGutterBufferDisable + autocmd BufFilePost * GitGutterBufferEnable + " Handle all buffers when focus is gained, but only after it was lost. " FocusGained gets triggered on startup with Neovim at least already. " Therefore this tracks also if it was lost before.