mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-22 04:21:08 +00:00
fix
This commit is contained in:
parent
2b0298d182
commit
ac9c6d67a9
2 changed files with 12 additions and 12 deletions
|
|
@ -161,7 +161,7 @@ if vim.lsp.inlay_hint then
|
|||
Snacks.toggle.inlay_hints():map("<leader>uh")
|
||||
end
|
||||
|
||||
if vim.lsp.codelens.enable then
|
||||
if vim.fn.has("nvim-0.12") == 1 then
|
||||
if Snacks.toggle.codelens then
|
||||
Snacks.toggle.codelens():map("<leader>cC")
|
||||
else
|
||||
|
|
@ -177,6 +177,10 @@ if vim.lsp.codelens.enable then
|
|||
end,
|
||||
}):map("<leader>cC")
|
||||
end
|
||||
else
|
||||
require("lazyvim.plugins.lsp.keymaps").set({}, {
|
||||
{ "<leader>cC", vim.lsp.codelens.refresh, desc = "Refresh & Display Codelens", mode = { "n" }, has = "codeLens" },
|
||||
})
|
||||
end
|
||||
|
||||
-- lazygit
|
||||
|
|
|
|||
|
|
@ -201,18 +201,14 @@ return {
|
|||
-- code lens
|
||||
if opts.codelens.enabled then
|
||||
Snacks.util.lsp.on({ method = "textDocument/codeLens" }, function(buffer)
|
||||
if vim.lsp.codelens.enable then
|
||||
-- nvim v0.12
|
||||
if
|
||||
vim.api.nvim_buf_is_valid(buffer)
|
||||
and vim.bo[buffer].buftype == ""
|
||||
and not vim.tbl_contains(opts.codelens.exclude, vim.bo[buffer].filetype)
|
||||
then
|
||||
if
|
||||
vim.api.nvim_buf_is_valid(buffer)
|
||||
and vim.bo[buffer].buftype == ""
|
||||
and not vim.tbl_contains(opts.codelens.exclude, vim.bo[buffer].filetype)
|
||||
then
|
||||
if vim.fn.has("nvim-0.12") == 1 then
|
||||
vim.lsp.codelens.enable(true, { bufnr = buffer })
|
||||
end
|
||||
else
|
||||
-- nvim v0.11
|
||||
if not vim.tbl_contains(opts.codelens.exclude, vim.bo[buffer].filetype) then
|
||||
else
|
||||
vim.lsp.codelens.refresh()
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave" }, {
|
||||
buffer = buffer,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue