mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-31 01:44:58 +02:00
fix deprecation warning
code is copied from https://github.com/vim-airline/vim-airline/issues/2289 originally contributed by @cmccannbrite
This commit is contained in:
parent
731bdb11d2
commit
5eae08609e
@ -25,7 +25,11 @@ function! airline#extensions#nvimlsp#get(type) abort
|
|||||||
|
|
||||||
let symbol = is_err ? error_symbol : warning_symbol
|
let symbol = is_err ? error_symbol : warning_symbol
|
||||||
|
|
||||||
let num = v:lua.vim.lsp.util.buf_diagnostics_count(a:type)
|
if luaeval("pcall(require, 'vim.lsp.diagnostic')")
|
||||||
|
let num = v:lua.vim.lsp.diagnostic.get_count(0, a:type)
|
||||||
|
else
|
||||||
|
let num = v:lua.vim.lsp.util.buf_diagnostics_count(a:type)
|
||||||
|
endif
|
||||||
|
|
||||||
return s:airline_nvimlsp_count(num, symbol)
|
return s:airline_nvimlsp_count(num, symbol)
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user