File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -634,6 +634,16 @@ require('lazy').setup({
634634 end
635635 end
636636
637+ -- Show diagnostics in floating window on cursor hold
638+ local diagnostic_augroup = vim .api .nvim_create_augroup (' kickstart-lsp-diagnostics' , { clear = false })
639+ vim .api .nvim_create_autocmd (' CursorHold' , {
640+ buffer = event .buf ,
641+ group = diagnostic_augroup ,
642+ callback = function ()
643+ vim .diagnostic .open_float (nil , { focus = false , scope = ' cursor' })
644+ end ,
645+ })
646+
637647 -- The following two autocommands are used to highlight references of the
638648 -- word under your cursor when your cursor rests there for a little while.
639649 -- See `:help CursorHold` for information about when this is executed
@@ -659,6 +669,7 @@ require('lazy').setup({
659669 callback = function (event2 )
660670 vim .lsp .buf .clear_references ()
661671 vim .api .nvim_clear_autocmds { group = ' kickstart-lsp-highlight' , buffer = event2 .buf }
672+ vim .api .nvim_clear_autocmds { group = ' kickstart-lsp-diagnostics' , buffer = event2 .buf }
662673 end ,
663674 })
664675 end
You can’t perform that action at this time.
0 commit comments