mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-01-21 00:45:16 +08:00
Merge pull request #2325 from dutchgecko/fix_2324_neovim
Ensure correct checking of LSP support on neovim
This commit is contained in:
commit
6def2f0a82
|
@ -338,7 +338,8 @@ function! airline#extensions#load()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if (get(g:, 'airline#extensions#nvimlsp#enabled', 1)
|
if (get(g:, 'airline#extensions#nvimlsp#enabled', 1)
|
||||||
\ && has("nvim"))
|
\ && has('nvim')
|
||||||
|
\ && luaeval('vim.lsp ~= nil'))
|
||||||
call airline#extensions#nvimlsp#init(s:ext)
|
call airline#extensions#nvimlsp#init(s:ext)
|
||||||
call add(s:loaded_ext, 'nvimlsp')
|
call add(s:loaded_ext, 'nvimlsp')
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
scriptencoding utf-8
|
scriptencoding utf-8
|
||||||
|
|
||||||
if !(get(g:, 'airline#extensions#nvimlsp#enabled', 1)
|
if !(get(g:, 'airline#extensions#nvimlsp#enabled', 1)
|
||||||
\ && has("nvim"))
|
\ && has('nvim')
|
||||||
|
\ && luaeval('vim.lsp ~= nil'))
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -14,8 +15,7 @@ function! s:airline_nvimlsp_count(cnt, symbol) abort
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! airline#extensions#nvimlsp#get(type) abort
|
function! airline#extensions#nvimlsp#get(type) abort
|
||||||
if !exists("v:lua.vim.lsp.buf_get_clients()") ||
|
if luaeval('vim.tbl_isempty(vim.lsp.buf_get_clients(0))')
|
||||||
\ empty(v:lua.vim.lsp.buf_get_clients(0))
|
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user