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

next
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. */
if (parent->layout != L_SPLITH && parent->layout != L_SPLITV) {
layout = parent->last_split_layout;
/* In case last_split_layout was not initialized… */
if (layout == L_DEFAULT) {
layout = L_SPLITH;
}
} else {
layout = (parent->layout == L_SPLITH) ? L_SPLITV : L_SPLITH;
}