Add null accent, to allow accents to be removed

This commit is contained in:
Simon Ratner 2013-12-20 09:02:34 -08:00 committed by Christian Brabandt
parent 168b18ff0a
commit 0b1df0c524
2 changed files with 10 additions and 1 deletions

View File

@ -45,6 +45,7 @@ function! airline#themes#patch(palette)
endfor
let a:palette.accents = get(a:palette, 'accents', {})
let a:palette.accents.none = [ '', '', '', '', '' ]
let a:palette.accents.bold = [ '', '', '', '', 'bold' ]
let a:palette.accents.italic = [ '', '', '', '', 'italic' ]

View File

@ -837,11 +837,19 @@ colors instead of the section's default foreground color.
The following accents are defined by default. Themes can define their variants
of the colors, but defaults will be provided if missing. >
bold, italic, red, green, blue, yellow, orange, purple
bold, italic, red, green, blue, yellow, orange, purple, none
<
The defaults configure the mode and line number parts to be bold, and the
readonly part to be red.
"none" is special. This can be used, to remove a bold accent from an existing
theme. For example, usually the mode part of the statusline is usually defined
to be bold. However, it can be hard to remove an existing bold accent from the
default configuration. Therefore, you can use the none accent to remove
existing accents, so if you put >
call airline#parts#define_accent('mode', 'none')
the mode section will be set to non-bold font style.
------------------------------------- *airline-sections*
Once a part is defined, you can use helper functions to generate the
statuslines for each section. For example, to use the part above, we could