1
0
Fork 0

nvim: Fix codeLens refreshing

This commit is contained in:
Daniel Kempkens 2022-04-24 00:15:43 +02:00
parent 6f237fea8c
commit 84572bde0b

View file

@ -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}))))