mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-28 08:24:24 +02:00
nvimlsp: use vim.diagnostic.get() if available
This commit is contained in:
parent
bf5d785932
commit
9a3568b815
@ -26,7 +26,10 @@ function! airline#extensions#nvimlsp#get(type) abort
|
|||||||
|
|
||||||
let symbol = is_err ? error_symbol : warning_symbol
|
let symbol = is_err ? error_symbol : warning_symbol
|
||||||
|
|
||||||
if luaeval("pcall(require, 'vim.lsp.diagnostic')")
|
if luaeval("pcall(require, 'vim.diagnostic')")
|
||||||
|
let severity = a:type == 'Warning' ? 'Warn' : a:type
|
||||||
|
let num = len(v:lua.vim.diagnostic.get(0, { 'severity': severity }))
|
||||||
|
elseif luaeval("pcall(require, 'vim.lsp.diagnostic')")
|
||||||
let num = v:lua.vim.lsp.diagnostic.get_count(0, a:type)
|
let num = v:lua.vim.lsp.diagnostic.get_count(0, a:type)
|
||||||
else
|
else
|
||||||
let num = v:lua.vim.lsp.util.buf_diagnostics_count(a:type)
|
let num = v:lua.vim.lsp.util.buf_diagnostics_count(a:type)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user