Skip to content

Commit 8c955db

Browse files
committed
Fix: ensure diagnostics changes trigger a statusline redraw
1 parent 879a30d commit 8c955db

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lua/lsp-status.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,20 @@ end
8181
local function on_attach(client)
8282
-- Register the client for messages
8383
messaging.register_client(client.id, client.name)
84+
vim.api.nvim_command('augroup lsp_aucmds')
85+
vim.api.nvim_command('au! * <buffer>')
86+
vim.api.nvim_command('au User LspDiagnosticsChanged let g:lsp_status_redraw = v:true')
8487

8588
-- If the client is a documentSymbolProvider, set up an autocommand
8689
-- to update the containing symbol
8790
if _config.current_function and client.resolved_capabilities.document_symbol then
88-
vim.api.nvim_command('augroup lsp_aucmds')
8991
vim.api.nvim_command(
9092
'au CursorHold <buffer> lua require("lsp-status").update_current_function()'
9193
)
92-
vim.api.nvim_command('augroup END')
9394
end
9495

96+
vim.api.nvim_command('augroup END')
97+
9598
timer.register_timer()
9699
end
97100

0 commit comments

Comments
 (0)