1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-11 07:10:39 +02:00

fix: correctly check layout of container

This commit is contained in:
oddlama 2023-10-06 01:13:42 +02:00
parent f37e75da40
commit 0e6d7f0afd
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A

View file

@ -137,6 +137,11 @@ fn cmd_toggle_layout(config: &Config, workspace: &Node) -> Option<String> {
return None;
}
// Don't do anything if the layout is already correct
if &con.layout == desired_layout {
return None
}
con = &con.nodes[0];
} else {
// Strangely enough, setting a layout on the workspace container will create a new
@ -144,11 +149,6 @@ fn cmd_toggle_layout(config: &Config, workspace: &Node) -> Option<String> {
// we can operate on the workspace.
}
// Don't do anything if the layout is already correct
if &con.layout == desired_layout {
return None
}
let desired_layout = match desired_layout {
NodeLayout::SplitH => "splith",
NodeLayout::SplitV => "splitv",