From f39e88cfa8d81d54e65ae05678fbfb735f793828 Mon Sep 17 00:00:00 2001 From: w0rp Date: Mon, 13 Feb 2017 23:31:29 +0000 Subject: #274 - Fix airline integration when ALE is not loaded fully --- autoload/ale/statusline.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'autoload') diff --git a/autoload/ale/statusline.vim b/autoload/ale/statusline.vim index 7269ddca..efb7e9e5 100644 --- a/autoload/ale/statusline.vim +++ b/autoload/ale/statusline.vim @@ -3,6 +3,10 @@ " Update the buffer error/warning count with data from loclist. function! ale#statusline#Update(buffer, loclist) abort + if !exists('g:ale_buffer_info') + return + endif + if !has_key(g:ale_buffer_info, a:buffer) return endif @@ -39,6 +43,10 @@ endfunction " Returns a tuple of errors and warnings for use in third-party integrations. function! ale#statusline#Count(buffer) abort + if !exists('g:ale_buffer_info') + return [0, 0] + endif + if !s:SetupCount(a:buffer) return [0, 0] endif @@ -48,6 +56,10 @@ endfunction " Returns a formatted string that can be integrated in the statusline. function! ale#statusline#Status() abort + if !exists('g:ale_buffer_info') + return 'OK' + endif + let [l:error_format, l:warning_format, l:no_errors] = g:ale_statusline_format let l:buffer = bufnr('%') -- cgit v1.2.3