mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Remove the need to check vim version
This commit is contained in:
parent
8a24b61aed
commit
8f25c56bf6
2 changed files with 5 additions and 12 deletions
|
|
@ -115,16 +115,12 @@ return {
|
|||
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
|
||||
end
|
||||
|
||||
local inlay_hint = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint
|
||||
local inlay_hint = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint.enable
|
||||
|
||||
if opts.inlay_hints.enabled and inlay_hint then
|
||||
Util.lsp.on_attach(function(client, buffer)
|
||||
if client.supports_method("textDocument/inlayHint") then
|
||||
if vim.fn.has("nvim-0.10") == 1 then
|
||||
inlay_hint.enable(buffer, true)
|
||||
else
|
||||
inlay_hint(buffer, true)
|
||||
end
|
||||
inlay_hint(buffer, true)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -125,12 +125,9 @@ end
|
|||
---@param bufnr? number
|
||||
function M.toggle_inline_hint(bufnr)
|
||||
bufnr = bufnr or 0
|
||||
if vim.fn.has("nvim-0.10") then
|
||||
if vim.lsp.inlay_hint.is_enabled() then
|
||||
vim.lsp.inlay_hint.enable(bufnr, false)
|
||||
else
|
||||
vim.lsp.inlay_hint.enable(bufnr, true)
|
||||
end
|
||||
local inlay_hint = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint
|
||||
if inlay_hint.enable then
|
||||
vim.lsp.inlay_hint.enable(bufnr, not inlay_hint.is_enabled())
|
||||
else
|
||||
vim.lsp.inlay_hint(bufnr, nil)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue