Merge pull request #2287 from timfeirg/master

buf_diagnostics_count is deprecated. Use 'vim.lsp.diagnostic.get_count'
This commit is contained in:
Christian Brabandt 2020-11-14 12:11:18 +01:00 committed by GitHub
commit 536667191d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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