Skip to content
This repository was archived by the owner on Jul 6, 2021. It is now read-only.

Commit 6adf7ee

Browse files
committed
fix: diagnostic on not exist buffer spam errors
1 parent 3baf221 commit 6adf7ee

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lua/diagnostic.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ function M.diagnostics_loclist(local_result)
6969
end
7070

7171
function M.publish_diagnostics(bufnr)
72+
if vim.fn.filereadable(vim.fn.expand("%")) == 0 then
73+
return
74+
end
7275
if vim.fn.getcmdwintype() == ':' then return end
7376
if #vim.lsp.buf_get_clients() == 0 then return end
7477
local result = M.bufferDiagnostic[bufnr]

0 commit comments

Comments
 (0)