nvim: Fix codeLens refreshing
This commit is contained in:
parent
6f237fea8c
commit
84572bde0b
1 changed files with 6 additions and 2 deletions
|
@ -2,6 +2,10 @@
|
||||||
cmd vim.cmd
|
cmd vim.cmd
|
||||||
api vim.api
|
api vim.api
|
||||||
keymap (require :nifoc.keymap)]
|
keymap (require :nifoc.keymap)]
|
||||||
|
(fn maybe-refresh-codelens [client]
|
||||||
|
(when client.server_capabilities.codeLensProvider
|
||||||
|
(vim.lsp.codelens.refresh)))
|
||||||
|
|
||||||
(fn mod.setup []
|
(fn mod.setup []
|
||||||
(vim.diagnostic.config {:underline true
|
(vim.diagnostic.config {:underline true
|
||||||
:virtual_text false
|
:virtual_text false
|
||||||
|
@ -23,10 +27,10 @@
|
||||||
(aucmd [:CursorHold :CursorHoldI]
|
(aucmd [:CursorHold :CursorHoldI]
|
||||||
{:callback (fn []
|
{:callback (fn []
|
||||||
(vim.diagnostic.open_float nil {:focus false})
|
(vim.diagnostic.open_float nil {:focus false})
|
||||||
(vim.lsp.codelens.refresh))
|
(maybe-refresh-codelens client))
|
||||||
:buffer bufnr
|
:buffer bufnr
|
||||||
:group augroup})
|
:group augroup})
|
||||||
(aucmd :InsertLeave {:callback #(vim.lsp.codelens.refresh)
|
(aucmd :InsertLeave {:callback #(maybe-refresh-codelens client)
|
||||||
:buffer bufnr
|
:buffer bufnr
|
||||||
:group augroup}))))
|
:group augroup}))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue