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

Commit

Permalink
fix: clear_diagnostics before saving(#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
haorenW1025 committed Jul 8, 2020
1 parent c1ddb0d commit d7734f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/diagnostic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function M.modifyCallback()
if vim.api.nvim_get_var('diagnostic_level') ~= nil then
result.diagnostics = remove_diagnostics(result.diagnostics)
end
vim.lsp.util.buf_clear_diagnostics(bufnr)
vim.lsp.util.buf_diagnostics_save_positions(bufnr, result.diagnostics)
if vim.api.nvim_get_var('diagnostic_insert_delay') == 1 then
if vim.api.nvim_get_mode()['mode'] == "i" or vim.api.nvim_get_mode()['mode'] == "ic" then
Expand All @@ -70,7 +71,6 @@ end

function M.publish_diagnostics(bufnr)
if vim.fn.getcmdwintype() == ':' then return end
vim.lsp.util.buf_clear_diagnostics(bufnr)
if #vim.lsp.buf_get_clients() == 0 then return end
local diagnostics = vim.lsp.util.diagnostics_by_buf[bufnr]
if diagnostics == nil then return end
Expand Down

0 comments on commit d7734f1

Please sign in to comment.