Update signs when file renamed via :saveas

Fixes #551.
This commit is contained in:
Andy Stewart
2019-06-04 12:37:59 +01:00
parent 25f3c56335
commit 07b60b584e
2 changed files with 4 additions and 0 deletions

View File

@@ -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

View File

@@ -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.