fix(watcher): improve buffer check in handler

This commit is contained in:
Ivan Pankratov 2024-03-17 12:27:32 +05:00 committed by Lewis Russell
parent 4e348641b8
commit 078041e9d0
1 changed files with 6 additions and 1 deletions

View File

@ -64,7 +64,12 @@ local handler = debounce_trailing(
--- @param bufnr integer
async.void(function(bufnr)
local __FUNC__ = 'watcher_handler'
buf_check(bufnr)
-- Avoid cache hit for detached buffer
-- ref: https://github.com/lewis6991/gitsigns.nvim/issues/956
if not buf_check(bufnr) then
return
end
local git_obj = cache[bufnr].git_obj