From c2632f9dbb7237494f08fec1e8ecb1654ca5f55b Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Thu, 22 Aug 2013 19:55:04 -0400 Subject: [PATCH] introduce g:airline_theme_patch_func (#173). --- autoload/airline.vim | 5 +++++ doc/airline.txt | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/autoload/airline.vim b/autoload/airline.vim index 456a4585..69eb4c0b 100644 --- a/autoload/airline.vim +++ b/autoload/airline.vim @@ -14,6 +14,11 @@ function! airline#switch_theme(name) let palette = g:airline#themes#{g:airline_theme}#palette "also lazy loads the theme call airline#themes#patch(palette) + if exists('g:airline_theme_patch_func') + let Fn = function(g:airline_theme_patch_func) + call Fn(palette) + endif + let w:airline_lastmode = '' call airline#update_statusline() call airline#load_theme() diff --git a/doc/airline.txt b/doc/airline.txt index 202c8750..7f1feeb8 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -60,6 +60,17 @@ values): can be overridden by defining a value. > let g:airline_theme= < +* if you want to patch the airline theme before it gets applied, you can + supply the name of a function where you can modify the palette. > + let g:airline_theme_patch_func = 'AirlineThemePatch' + function! AirlineThemePatch(palette) + if g:airline_theme == 'badwolf' + for colors in values(a:palette.inactive) + let colors[3] = 245 + endfor + endif + endfunction +< * enable/disable usage of patched powerline font symbols > let g:airline_powerline_fonts=0 <