From 7f068311d5f7de5c3fe976a60a543aec7dbd5bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Sun, 17 Dec 2023 23:14:34 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(nvim):=20check=20?= =?UTF-8?q?if=20using=20nvim=200.10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/nvim/lua/plugins/lspconfig.lua | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.config/nvim/lua/plugins/lspconfig.lua b/.config/nvim/lua/plugins/lspconfig.lua index c4871a03..95f62ebc 100644 --- a/.config/nvim/lua/plugins/lspconfig.lua +++ b/.config/nvim/lua/plugins/lspconfig.lua @@ -1,3 +1,5 @@ +local nvim_0_10 = vim.fn.has("nvim-0.10") + local function toggle_diag_virtext() local virtual_text = { -- Default virtual_text opts from Lazy.Nvim spacing = 4, @@ -65,7 +67,7 @@ return { }, }, inlay_hints = { - enabled = true, + enabled = nvim_0_10, }, servers = { -- typos_lsp = { @@ -138,13 +140,7 @@ return { opts = function(_, opts) opts.tools = { inlay_hints = { - auto = function() - if vim.fn.has("nvim-0.10") == 1 then - return false - else - return true - end - end, + auto = not nvim_0_10, }, } end,