Skip to content

Commit

Permalink
fix: check buffer valid before set diagnostic (#389)
Browse files Browse the repository at this point in the history
Co-authored-by: Towry <towry@users.noreply.github.com>
  • Loading branch information
towry and towry authored Apr 28, 2024
1 parent 44536f5 commit 4e6bf45
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lua/neotest/consumers/diagnostic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ local function init(client)
logger.debug("Setting diagnostics for", self.file_path, diagnostics)

vim.schedule(function()
if not vim.api.nvim_buf_is_valid(self.bufnr) then return end
diag.set(diag_namespace, self.bufnr, diagnostics)
end)
end
Expand Down

0 comments on commit 4e6bf45

Please sign in to comment.