Adding a mention of add_inactive_statusline_func (as suggested in this issue: https://github.com/vim-airline/vim-airline/issues/987)

da99 2016-02-03 23:26:50 -06:00
parent fe2672c58c
commit 7aa233f59d

@ -8,4 +8,21 @@ Feel free to add your special configuration, if it fixes a need.
Prepend a '$' when obsession is enabled ([origin](https://github.com/vim-airline/vim-airline/issues/777#issuecomment-113704356)) Prepend a '$' when obsession is enabled ([origin](https://github.com/vim-airline/vim-airline/issues/777#issuecomment-113704356))
```viml ```viml
let g:airline_section_z = airline#section#create(['%{ObsessionStatus(''$'', '''')}', 'windowswap', '%3p%% ', 'linenr', ':%3v ']) let g:airline_section_z = airline#section#create(['%{ObsessionStatus(''$'', '''')}', 'windowswap', '%3p%% ', 'linenr', ':%3v '])
``` ```
## Overriding the inactive statusline
`add_inactive_statusline_func` (counterpart to `add_statusline_func`) can be used to add to (or completely override) the inactive statusline:
```viml
function! Render_Only_File(...)
let builder = a:1
let context = a:2
call builder.add_section('file', '!! %F')
return 0 " the default: draw the rest of the statusline
return -1 " do not modify the statusline
return 1 " modify the statusline with the current contents of the builder
endfunction
call airline#add_inactive_statusline_func('Render_Only_File')
```
More information on the use of the `builder` and `context` arguments can be found in `:help` section [airline-funcrefs](https://github.com/vim-airline/vim-airline/blob/master/doc/airline.txt#L784).