aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.config/nvim/lua.lua
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2025-05-07 17:58:00 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2025-05-07 17:58:00 +0300
commit451c87c4b97c1092ac0354cf7d3dd842429fe548 (patch)
tree56fd36a21f41a9cf8fbd60ca04ed225e8d2f0656 /dotfiles/.config/nvim/lua.lua
parent919300346419eecc5f1a066b58b63b7f0e7ede99 (diff)
downloadvimrice-451c87c4b97c1092ac0354cf7d3dd842429fe548.tar.gz
vimrice-451c87c4b97c1092ac0354cf7d3dd842429fe548.zip
make use of newer diagnostics API for nvim >= 0.11
Diffstat (limited to 'dotfiles/.config/nvim/lua.lua')
-rw-r--r--dotfiles/.config/nvim/lua.lua21
1 files changed, 17 insertions, 4 deletions
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