Skip to content

Commit

Permalink
fix(watcher): improve buffer check in handler
Browse files Browse the repository at this point in the history
  • Loading branch information
impankratov authored and lewis6991 committed Mar 17, 2024
1 parent 4e34864 commit 078041e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/gitsigns/watcher.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 078041e

Please sign in to comment.