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

Commit

Permalink
Extract the changed event into a module function
Browse files Browse the repository at this point in the history
  • Loading branch information
ndreas committed Jun 30, 2020
1 parent f8b312d commit eca5f6e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lua/diagnostic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,12 @@ function M.publish_diagnostics(bufnr)
util.buf_diagnostics_virtual_text(bufnr, result.diagnostics)
end
M.diagnostics_loclist(result)
M.trigger_diagnostics_changed()
end

vim.schedule_wrap(function()
M.trigger_diagnostics_changed = vim.schedule_wrap(function()
vim.api.nvim_command("doautocmd User LspDiagnosticsChanged")
end)()
end
end)

function M.refresh_diagnostics()
local bufnr = vim.api.nvim_win_get_buf(0)
Expand Down

0 comments on commit eca5f6e

Please sign in to comment.