From 4a1ac562862562bcde58152be7968419addeafd7 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Wed, 29 May 2019 21:04:32 +0200 Subject: [PATCH] Define coc functions as empty by default fixes #1926 --- autoload/airline/extensions/coc.vim | 4 ++++ autoload/airline/init.vim | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/autoload/airline/extensions/coc.vim b/autoload/airline/extensions/coc.vim index 9ae7857..f81fce6 100644 --- a/autoload/airline/extensions/coc.vim +++ b/autoload/airline/extensions/coc.vim @@ -1,3 +1,4 @@ +scriptencoding utf-8 let s:error_symbol = get(g:, 'airline#extensions#coc#error_symbol', 'E:') let s:warning_symbol = get(g:, 'airline#extensions#coc#warning_symbol', 'W:') @@ -11,6 +12,9 @@ function! airline#extensions#coc#get_error() endfunction function! airline#extensions#coc#get(type) + if !exists(":CocCommand") + return '' + endif let _backup = get(g:, 'coc_stl_format', '') let is_err = (a:type is# 'error') if is_err diff --git a/autoload/airline/init.vim b/autoload/airline/init.vim index 1d5d26f..095155c 100644 --- a/autoload/airline/init.vim +++ b/autoload/airline/init.vim @@ -164,7 +164,8 @@ function! airline#init#bootstrap() \ 'syntastic-err', 'eclim', 'whitespace','windowswap', \ 'ycm_error_count', 'ycm_warning_count', 'neomake_error_count', \ 'neomake_warning_count', 'ale_error_count', 'ale_warning_count', - \ 'languageclient_error_count', 'languageclient_warning_count']) + \ 'languageclient_error_count', 'languageclient_warning_count', + \ 'coc_warning_count', 'coc_error_count']) call airline#parts#define_text('bookmark', '') call airline#parts#define_text('capslock', '') call airline#parts#define_text('gutentags', '')