From 26014ca1a22c1b862c782f4dfa3d40a5ab629627 Mon Sep 17 00:00:00 2001 From: Dan Elkouby Date: Thu, 12 Oct 2017 23:44:25 +0300 Subject: [PATCH] Default to L_SPLITH with toggle split when last_split_layout hasn't been initialized --- src/con.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/con.c b/src/con.c index 88d1e744..1de91d00 100644 --- a/src/con.c +++ b/src/con.c @@ -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; }