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

Commit eca5f6e

Browse files
committed
Extract the changed event into a module function
1 parent f8b312d commit eca5f6e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

lua/diagnostic.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,12 @@ function M.publish_diagnostics(bufnr)
8787
util.buf_diagnostics_virtual_text(bufnr, result.diagnostics)
8888
end
8989
M.diagnostics_loclist(result)
90+
M.trigger_diagnostics_changed()
91+
end
9092

91-
vim.schedule_wrap(function()
93+
M.trigger_diagnostics_changed = vim.schedule_wrap(function()
9294
vim.api.nvim_command("doautocmd User LspDiagnosticsChanged")
93-
end)()
94-
end
95+
end)
9596

9697
function M.refresh_diagnostics()
9798
local bufnr = vim.api.nvim_win_get_buf(0)

0 commit comments

Comments
 (0)