From 9dd682212fe4311786b2e479b26c66c4d67ff171 Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Tue, 13 Aug 2013 20:43:04 +0000 Subject: [PATCH] make warning a real section. references #136. --- autoload/airline.vim | 2 +- doc/airline.txt | 9 +++++---- plugin/airline.vim | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/autoload/airline.vim b/autoload/airline.vim index b9ab8f2..cb5aab1 100644 --- a/autoload/airline.vim +++ b/autoload/airline.vim @@ -109,7 +109,7 @@ function! airline#get_statusline(winnr, active) if a:active let sl.='%(%#Al2_to_warningmsg#'.g:airline_right_sep - let sl.='%#warningmsg#'.s:getwinvar(a:winnr, 'airline_section_warning', '').'%)' + let sl.='%#warningmsg#'.s:get_section(a:winnr, 'warning', '', '').'%)' endif endif return sl diff --git a/doc/airline.txt b/doc/airline.txt index c42836a..a7620ba 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -139,7 +139,6 @@ CUSTOMIZATION *airline-customization* The following are some unicode symbols for customizing the left/right separators, as well as the powerline font glyths. - > " unicode symbols let g:airline_left_sep = 'ยป' @@ -175,10 +174,12 @@ separators, as well as the powerline font glyths. < For more intricate customizations, you can replace the predefined sections -with the usual statusline syntax. - +with the usual statusline syntax. Note that many of these settings can also be +controlled with |airline-configuration| variables, which is useful for +sections which by default host more than one extension. > - " here are the the default values + variable names default contents + ---------------------------------------------------------------------------- let g:airline_section_a (the mode/paste indicator) let g:airline_section_b (the fugitive/lawrencium branch indicator) let g:airline_section_c (bufferline or filename) diff --git a/plugin/airline.vim b/plugin/airline.vim index dbd8884..ee8f7f8 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -63,6 +63,7 @@ call s:check_defined('g:airline_section_gutter', '') call s:check_defined('g:airline_section_x', "%{strlen(&filetype)>0?&filetype:''}") call s:check_defined('g:airline_section_y', "%{strlen(&fenc)>0?&fenc:''}%{strlen(&ff)>0?'['.&ff.']':''}") call s:check_defined('g:airline_section_z', '%3p%% '.g:airline_linecolumn_prefix.'%3l:%3c') +call s:check_defined('g:airline_section_warning', '') let s:airline_initialized = 0 function! s:on_window_changed()