diff options
author | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2025-05-07 17:58:00 +0300 |
---|---|---|
committer | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2025-05-07 17:58:00 +0300 |
commit | 451c87c4b97c1092ac0354cf7d3dd842429fe548 (patch) | |
tree | 56fd36a21f41a9cf8fbd60ca04ed225e8d2f0656 /dotfiles | |
parent | 919300346419eecc5f1a066b58b63b7f0e7ede99 (diff) | |
download | vimrice-451c87c4b97c1092ac0354cf7d3dd842429fe548.tar.gz vimrice-451c87c4b97c1092ac0354cf7d3dd842429fe548.zip |
make use of newer diagnostics API for nvim >= 0.11
Diffstat (limited to 'dotfiles')
-rw-r--r-- | dotfiles/.config/nvim/lua.lua | 21 |
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 |