mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-04-08 19:35:31 +02:00
check the api-version before using the new api
This commit is contained in:
parent
c3d1d13b72
commit
61d354cc40
@ -15,8 +15,16 @@ function! s:airline_nvimlsp_count(cnt, symbol) abort
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#nvimlsp#get(type) abort
|
||||
if luaeval('vim.tbl_isempty(vim.lsp.get_clients())')
|
||||
return ''
|
||||
" Api-change in nvim 0.11
|
||||
" level 12 seems to be nvim 0.10
|
||||
if api_info().version.api_level > 12
|
||||
if luaeval('vim.tbl_isempty(vim.lsp.get_clients())')
|
||||
return ''
|
||||
endif
|
||||
else
|
||||
if luaeval('vim.tbl_isempty(vim.lsp.buf_get_clients(0))')
|
||||
return ''
|
||||
endif
|
||||
endif
|
||||
|
||||
let error_symbol = get(g:, 'airline#extensions#nvimlsp#error_symbol', 'E:')
|
||||
|
Loading…
x
Reference in New Issue
Block a user