From 72b316c87176ff4227a678209d25fecdc764185a Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Thu, 23 Jun 2016 18:04:23 +0200 Subject: [PATCH] Cache eclim errorlist fixes #1193 --- autoload/airline/extensions/eclim.vim | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/autoload/airline/extensions/eclim.vim b/autoload/airline/extensions/eclim.vim index 50cef99..9f5a17d 100644 --- a/autoload/airline/extensions/eclim.vim +++ b/autoload/airline/extensions/eclim.vim @@ -16,7 +16,13 @@ function! airline#extensions#eclim#creat_line(...) endfunction function! airline#extensions#eclim#get_warnings() + " Cache vavlues, so that it isn't called too often + if exists("s:eclim_errors") && + \ get(b:, 'airline_changenr', 0) == changenr() + return s:eclim_errors + endif let eclimList = eclim#display#signs#GetExisting() + let s:eclim_errors = '' if !empty(eclimList) " Remove any non-eclim signs (see eclim#display#signs#Update) @@ -39,11 +45,12 @@ function! airline#extensions#eclim#get_warnings() let errorsNumber = len(eclimList) let errors = "[Eclim:" . type . " line:".string(errorsLine)." (".string(errorsNumber).")]" if !exists(':SyntasticCheck') || SyntasticStatuslineFlag() == '' - return errors.(g:airline_symbols.space) + let s:eclim_errors = errors.(g:airline_symbols.space) endif endif endif - return '' + let b:airline_changenr = changenr() + return s:eclim_errors endfunction function! airline#extensions#eclim#init(ext)