Skip to content

Commit

Permalink
fix(lsp): move augroup define to if statement (neovim#19406)
Browse files Browse the repository at this point in the history
  • Loading branch information
glepnir authored and smjonas committed Dec 31, 2022
1 parent 8571fe7 commit ee1bd96
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion runtime/lua/vim/diagnostic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,15 @@ local function schedule_display(namespace, bufnr, args)
bufs_waiting_to_update[bufnr][namespace] = args

local key = make_augroup_key(namespace, bufnr)
local group = vim.api.nvim_create_augroup(key, { clear = true })
if not registered_autocmds[key] then
local group = vim.api.nvim_create_augroup(key, { clear = true })
vim.api.nvim_create_autocmd(insert_leave_auto_cmds, {
group = group,
buffer = bufnr,
callback = function()
execute_scheduled_display(namespace, bufnr)
end,
desc = 'vim.diagnostic: display diagnostics',
})
registered_autocmds[key] = true
end
Expand Down

0 comments on commit ee1bd96

Please sign in to comment.