mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-06 12:14:24 +08:00
Ensure correct checking of LSP support on neovim
Check for differing neovim versions with different APIs for LSP. Fixes #2324 Consists of two tests: 1. Before extension load, test if this is neovim and whether this neovim supports LSP 2. When getting diagnostic counts, test whether a language server is attached to the current buffer
This commit is contained in:
@@ -338,7 +338,8 @@ function! airline#extensions#load()
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#nvimlsp#enabled', 1)
|
||||
\ && has("nvim"))
|
||||
\ && has('nvim')
|
||||
\ && luaeval('vim.lsp ~= nil'))
|
||||
call airline#extensions#nvimlsp#init(s:ext)
|
||||
call add(s:loaded_ext, 'nvimlsp')
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user