mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-01-19 23:02:44 +08:00
Merge pull request #2287 from timfeirg/master
buf_diagnostics_count is deprecated. Use 'vim.lsp.diagnostic.get_count'
This commit is contained in:
commit
536667191d
|
@ -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
|
||||||
|
|
||||||
|
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)
|
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…
Reference in New Issue
Block a user