Skip to content

Commit

Permalink
fix(diff): account for possible buffer wipeout during Git source attach
Browse files Browse the repository at this point in the history
Resolve #1530
  • Loading branch information
echasnovski committed Jan 28, 2025
1 parent 1f782e3 commit 12ebac8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/mini/diff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1620,6 +1620,10 @@ H.git_start_watching_index = function(buf_id, path)
-- If path is not in Git, disable buffer but make sure that it will not try
-- to re-attach until buffer is properly disabled
local on_not_in_git = vim.schedule_wrap(function()
if not vim.api.nvim_buf_is_valid(buf_id) then
H.cache[buf_id] = nil
return
end
MiniDiff.disable(buf_id)
H.git_cache[buf_id] = {}
end)
Expand Down

0 comments on commit 12ebac8

Please sign in to comment.