Skip to content

Commit

Permalink
fix: use new DiagnosticChanged event (#127)
Browse files Browse the repository at this point in the history
Use the new DiagnosticChanged event on neovim 0.6.

closes: #122
  • Loading branch information
abusch committed Dec 2, 2021
1 parent ce335ab commit 4d0a711
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugin/trouble.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@

augroup Trouble
autocmd!
au User LspDiagnosticsChanged lua require'trouble'.refresh({auto = true, provider = "diagnostics"})
if has('nvim-0.6')
" Use the new diagnostic subsystem for neovim 0.6 and up
au DiagnosticChanged * lua require'trouble'.refresh({auto = true, provider = "diagnostics"})
else
au User LspDiagnosticsChanged lua require'trouble'.refresh({auto = true, provider = "diagnostics"})
endif
autocmd BufWinEnter,BufEnter * lua require("trouble").action("on_win_enter")
augroup end

Expand Down

0 comments on commit 4d0a711

Please sign in to comment.