Default to L_SPLITH with toggle split when last_split_layout hasn't been initialized

This commit is contained in:
Dan Elkouby 2017-10-12 23:44:25 +03:00
parent a34a0048a1
commit 26014ca1a2
1 changed files with 4 additions and 0 deletions

View File

@ -1848,6 +1848,10 @@ void con_toggle_layout(Con *con, const char *toggle_mode) {
* change to the opposite split layout. */ * change to the opposite split layout. */
if (parent->layout != L_SPLITH && parent->layout != L_SPLITV) { if (parent->layout != L_SPLITH && parent->layout != L_SPLITV) {
layout = parent->last_split_layout; layout = parent->last_split_layout;
/* In case last_split_layout was not initialized… */
if (layout == L_DEFAULT) {
layout = L_SPLITH;
}
} else { } else {
layout = (parent->layout == L_SPLITH) ? L_SPLITV : L_SPLITH; layout = (parent->layout == L_SPLITH) ? L_SPLITV : L_SPLITH;
} }