♻️ refactor(nvim): check if using nvim 0.10

This commit is contained in:
Sergio Laín 2023-12-17 23:14:34 +01:00
parent 03803101ab
commit 7f068311d5
No known key found for this signature in database
GPG key ID: 14C9B8080681777B

View file

@ -1,3 +1,5 @@
local nvim_0_10 = vim.fn.has("nvim-0.10")
local function toggle_diag_virtext() local function toggle_diag_virtext()
local virtual_text = { -- Default virtual_text opts from Lazy.Nvim local virtual_text = { -- Default virtual_text opts from Lazy.Nvim
spacing = 4, spacing = 4,
@ -65,7 +67,7 @@ return {
}, },
}, },
inlay_hints = { inlay_hints = {
enabled = true, enabled = nvim_0_10,
}, },
servers = { servers = {
-- typos_lsp = { -- typos_lsp = {
@ -138,13 +140,7 @@ return {
opts = function(_, opts) opts = function(_, opts)
opts.tools = { opts.tools = {
inlay_hints = { inlay_hints = {
auto = function() auto = not nvim_0_10,
if vim.fn.has("nvim-0.10") == 1 then
return false
else
return true
end
end,
}, },
} }
end, end,