From d5f3bac8987690c0b7ce134beee101b278342058 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis Date: Sun, 31 Mar 2024 17:41:10 +0300 Subject: [PATCH] fix(lsp): check if `diagnostics.signs` is disabled by user --- lua/lazyvim/plugins/lsp/init.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index c2a74ef5..396c362b 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -120,10 +120,12 @@ return { -- diagnostics signs if vim.fn.has("nvim-0.10.0") == 0 then - for severity, icon in pairs(opts.diagnostics.signs.text) do - local name = vim.diagnostic.severity[severity]:lower():gsub("^%l", string.upper) - name = "DiagnosticSign" .. name - vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) + if type(opts.diagnostics.signs) ~= "boolean" then + for severity, icon in pairs(opts.diagnostics.signs.text) do + local name = vim.diagnostic.severity[severity]:lower():gsub("^%l", string.upper) + name = "DiagnosticSign" .. name + vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) + end end end