From 6adf7ee518288c5aa874af91b78cf9b3f7ead4c9 Mon Sep 17 00:00:00 2001 From: haorenW1025 Date: Fri, 5 Jun 2020 16:32:05 +0800 Subject: [PATCH] fix: diagnostic on not exist buffer spam errors --- lua/diagnostic.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/diagnostic.lua b/lua/diagnostic.lua index d88583b..1b9b573 100644 --- a/lua/diagnostic.lua +++ b/lua/diagnostic.lua @@ -69,6 +69,9 @@ function M.diagnostics_loclist(local_result) end function M.publish_diagnostics(bufnr) + if vim.fn.filereadable(vim.fn.expand("%")) == 0 then + return + end if vim.fn.getcmdwintype() == ':' then return end if #vim.lsp.buf_get_clients() == 0 then return end local result = M.bufferDiagnostic[bufnr]