You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was looking into customizing section z, so I went into the source code that initializes the section to copy-paste its default parts into my custom initialization function.
I've found that the airline#init#sections() function defines the default sections differently depending on some conditions; for example, for sections b and z the condition is window width:
if airline#util#winwidth() > 79
let g:airline_section_z = airline#section#create(['windowswap', 'obsession', '%p%%', 'linenr', 'maxlinenr', 'colnr'])
else
let g:airline_section_z = airline#section#create(['%p%%', 'linenr', 'colnr'])
endif
I did a couple of tests, and it seems that this means that the section contents depends on the windows width at startup, and does not change if the window size is modified (so if it started small, it will not add the other parts to it, and vice-versa). I assume this is the same for section c which also depends on a condition (autochdir).
Considering that it looks like airline offers support for conditional parts (line airline#parts#define_minwidth and airline#parts#define_condition), is this how the default initialization is supposed to happen? If yes, and I wanted to customize sections b/c/z, should I copy-paste the startup check, or am I supposed to used the conditional parts support?
I was looking into customizing section z, so I went into the source code that initializes the section to copy-paste its default parts into my custom initialization function.
I've found that the
airline#init#sections()
function defines the default sections differently depending on some conditions; for example, for sectionsb
andz
the condition is window width:I did a couple of tests, and it seems that this means that the section contents depends on the windows width at startup, and does not change if the window size is modified (so if it started small, it will not add the other parts to it, and vice-versa). I assume this is the same for section c which also depends on a condition (
autochdir
).Considering that it looks like airline offers support for conditional parts (line
airline#parts#define_minwidth
andairline#parts#define_condition
), is this how the default initialization is supposed to happen? If yes, and I wanted to customize sectionsb
/c
/z
, should I copy-paste the startup check, or am I supposed to used the conditional parts support?environment
The text was updated successfully, but these errors were encountered: