diff --git a/autoload/airline/highlighter.vim b/autoload/airline/highlighter.vim index f58ca2af..3203764f 100644 --- a/autoload/airline/highlighter.vim +++ b/autoload/airline/highlighter.vim @@ -53,7 +53,7 @@ function! airline#highlighter#reset_hlcache() endfunction function! airline#highlighter#get_highlight(group, ...) - if has_key(s:hl_groups, a:group) + if get(g:, 'airline_highlighting_cache', 0) && has_key(s:hl_groups, a:group) return s:hl_groups[a:group] else let fg = s:get_syn(a:group, 'fg') diff --git a/doc/airline.txt b/doc/airline.txt index e6b50f08..7b676c90 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -211,6 +211,10 @@ values): the same name (in the correct window): > let w:airline_skip_empty_sections = 0 < +* Caches the changes to the highlighting groups, should therefore be faster. + Set this to one, if you experience a sluggish Vim: > + let g:airline_highlighting_cache = 0 +< ============================================================================== COMMANDS *airline-commands* diff --git a/plugin/airline.vim b/plugin/airline.vim index 8f0b5316..0817a6b5 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -142,6 +142,7 @@ function! s:airline_refresh() let nomodeline = '' endif exe printf("silent doautocmd %s User AirlineBeforeRefresh", nomodeline) + call airline#highlighter#reset_hlcache() call airline#load_theme() call airline#update_statusline() endfunction