Do not draw separators for empty sections

This is a little bit a hack, because by the time the separators are
added, it is not clear, if the following section is empty, therefore
we need to parse the content of the following section and eval the
expressions to find out, if this is empty

Remarks:
- catch all exceptions when eval'ing statusline

- make sure, that the seperators are highlighted
  even when skipping empty regions (highlight group
  names need to be adjusted)

- if a section is defined as empty, it will be removed completly from
  the statusline. This means, it won't be called on the next update
  and may not refresh properly (e.g. when the whitespace check
  triggers, therefore, the whitesapce extension has to call an
  explicit redraw whenever it is supposed to be refreshed)
This commit is contained in:
Christian Brabandt
2016-04-18 15:33:47 +02:00
parent 811e51575c
commit 727208d766
3 changed files with 72 additions and 4 deletions

View File

@@ -140,6 +140,10 @@ values):
* disable the Airline customization for selective windows (this is a
window-local variable so you can disable it for only some windows) >
let w:airline_disabled = 1
* Do not draw separators for empty sections (only for the active window)
>
let g:airline_skip_empty_sections = 1
<
==============================================================================