nvimlsp: correctly call the lua functions for nvimlsp

closes #2324

Note: seems like one needs to call v:lua.vim.lsp.buf_get_clients() and
even then some older neovims do not understand that. So wrap it around
an exists() call and hope this works for all neovims.
This commit is contained in:
Christian Brabandt
2021-02-02 12:25:16 +01:00
parent bffa7a4d23
commit 50dfca52ed

View File

@@ -14,7 +14,8 @@ function! s:airline_nvimlsp_count(cnt, symbol) abort
endfunction
function! airline#extensions#nvimlsp#get(type) abort
if vim.lsp.buf_get_clients() == 0
if !exists("v:lua.vim.lsp.buf_get_clients()") ||
\ empty(v:lua.vim.lsp.buf_get_clients(0))
return ''
endif