mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-31 01:44:58 +02:00
check the api-version before using the new api
This commit is contained in:
parent
c3d1d13b72
commit
61d354cc40
@ -15,9 +15,17 @@ function! s:airline_nvimlsp_count(cnt, symbol) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! airline#extensions#nvimlsp#get(type) abort
|
function! airline#extensions#nvimlsp#get(type) abort
|
||||||
|
" 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())')
|
if luaeval('vim.tbl_isempty(vim.lsp.get_clients())')
|
||||||
return ''
|
return ''
|
||||||
endif
|
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:')
|
let error_symbol = get(g:, 'airline#extensions#nvimlsp#error_symbol', 'E:')
|
||||||
let warning_symbol = get(g:, 'airline#extensions#nvimlsp#warning_symbol', 'W:')
|
let warning_symbol = get(g:, 'airline#extensions#nvimlsp#warning_symbol', 'W:')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user