From dcabc38a12442a2d8351d88e580cbcf9de2388db Mon Sep 17 00:00:00 2001 From: David de Rosier Date: Mon, 31 Jan 2022 22:56:32 +0000 Subject: [PATCH] Fixes problem with disabling icons not working (#142) (#143) --- lua/navigator/diagnostics.lua | 4 +++- lua/navigator/lspclient/highlight.lua | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lua/navigator/diagnostics.lua b/lua/navigator/diagnostics.lua index be66659..8a24e0d 100644 --- a/lua/navigator/diagnostics.lua +++ b/lua/navigator/diagnostics.lua @@ -307,7 +307,9 @@ local diagnostic_cfg = { -- Enable underline, use default values underline = true, -- Enable virtual text, override spacing to 3 (prevent overlap) - virtual_text = { spacing = 3, prefix = _NgConfigValues.icons.diagnostic_virtual_text }, + virtual_text = { + spacing = 3, + prefix = _NgConfigValues.icons.icons and _NgConfigValues.icons.diagnostic_virtual_text or "" }, -- Use a function to dynamically turn signs off -- and on, using buffer local variables signs = true, diff --git a/lua/navigator/lspclient/highlight.lua b/lua/navigator/lspclient/highlight.lua index aac89b1..46417cc 100644 --- a/lua/navigator/lspclient/highlight.lua +++ b/lua/navigator/lspclient/highlight.lua @@ -25,7 +25,7 @@ function M.diagnositc_config_sign() icons.diagnostic_hint if vim.diagnostic ~= nil then local t = vim.fn.sign_getdefined('DiagnosticSignWarn') - if vim.tbl_isempty(t) or t[1].text == "W " and icons.icons == true then + if (vim.tbl_isempty(t) or t[1].text == "W ") and icons.icons == true then vim.fn.sign_define('DiagnosticSignError', {text = e, texthl = 'DiagnosticError', linehl = '', numhl = ''}) @@ -40,7 +40,7 @@ function M.diagnositc_config_sign() end else local t = vim.fn.sign_getdefined('LspDiagnosticSignWarn') - if vim.tbl_isempty(t) or t[1].text == "W " and icons.icons == true then + if (vim.tbl_isempty(t) or t[1].text == "W ") and icons.icons == true then vim.fn.sign_define('LspDiagnosticsSignError', {text = e, texthl = 'LspDiagnosticsSignError', linehl = '', numhl = ''}) vim.fn.sign_define('LspDiagnosticsSignWarning',