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

Commit d7734f1

Browse files
committed
fix: clear_diagnostics before saving(#40)
1 parent c1ddb0d commit d7734f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/diagnostic.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ function M.modifyCallback()
4848
if vim.api.nvim_get_var('diagnostic_level') ~= nil then
4949
result.diagnostics = remove_diagnostics(result.diagnostics)
5050
end
51+
vim.lsp.util.buf_clear_diagnostics(bufnr)
5152
vim.lsp.util.buf_diagnostics_save_positions(bufnr, result.diagnostics)
5253
if vim.api.nvim_get_var('diagnostic_insert_delay') == 1 then
5354
if vim.api.nvim_get_mode()['mode'] == "i" or vim.api.nvim_get_mode()['mode'] == "ic" then
@@ -70,7 +71,6 @@ end
7071

7172
function M.publish_diagnostics(bufnr)
7273
if vim.fn.getcmdwintype() == ':' then return end
73-
vim.lsp.util.buf_clear_diagnostics(bufnr)
7474
if #vim.lsp.buf_get_clients() == 0 then return end
7575
local diagnostics = vim.lsp.util.diagnostics_by_buf[bufnr]
7676
if diagnostics == nil then return end

0 commit comments

Comments
 (0)