mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-01-19 10:42:46 +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 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)
|
||||
endfunction
|
||||
|
|
Loading…
Reference in New Issue
Block a user