From 451c87c4b97c1092ac0354cf7d3dd842429fe548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Wed, 7 May 2025 17:58:00 +0300 Subject: make use of newer diagnostics API for nvim >= 0.11 --- dotfiles/.config/nvim/lua.lua | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'dotfiles/.config/nvim') diff --git a/dotfiles/.config/nvim/lua.lua b/dotfiles/.config/nvim/lua.lua index 4395485..5473841 100644 --- a/dotfiles/.config/nvim/lua.lua +++ b/dotfiles/.config/nvim/lua.lua @@ -61,7 +61,20 @@ end lsp_icons_setup() -vim.fn.sign_define('DiagnosticSignError', { text = '', texthl = 'DiagnosticSignError' }) -vim.fn.sign_define('DiagnosticSignWarn', { text = '', texthl = 'DiagnosticSignWarn' }) -vim.fn.sign_define('DiagnosticSignInfo', { text = '', texthl = 'DiagnosticSignInfo' }) -vim.fn.sign_define('DiagnosticSignHint', { text = '', texthl = 'DiagnosticSignHint' }) +if vim.fn.has('nvim-0.11') then + vim.diagnostic.config({ + signs = { + text = { + [vim.diagnostic.severity.ERROR] = '', + [vim.diagnostic.severity.WARN] = '', + [vim.diagnostic.severity.INFO] = '', + [vim.diagnostic.severity.HINT] = '', + }, + } + }) +else + vim.fn.sign_define('DiagnosticSignError', { text = '', texthl = 'DiagnosticSignError' }) + vim.fn.sign_define('DiagnosticSignWarn', { text = '', texthl = 'DiagnosticSignWarn' }) + vim.fn.sign_define('DiagnosticSignInfo', { text = '', texthl = 'DiagnosticSignInfo' }) + vim.fn.sign_define('DiagnosticSignHint', { text = '', texthl = 'DiagnosticSignHint' }) +end -- cgit v1.2.3