Skip to content

Commit

Permalink
fix(wm): apply ws cfgs only to declared ws indices
Browse files Browse the repository at this point in the history
This commit ensures that when attempting to reload the static
configuration file after the user has imperatively created new
workspaces, the configuration reload logic will not attempt to load a
workspace config for those imperatively created workspaces.
  • Loading branch information
LGUG2Z committed Nov 8, 2024
1 parent 36e3eaa commit 172988e
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions komorebi/src/static_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1106,12 +1106,9 @@ impl StaticConfig {
);

for (j, ws) in m.workspaces_mut().iter_mut().enumerate() {
ws.load_static_config(
monitor
.workspaces
.get(j)
.expect("no static workspace config"),
)?;
if let Some(workspace_config) = monitor.workspaces.get(j) {
ws.load_static_config(workspace_config)?;
}
}
}

Expand Down Expand Up @@ -1169,12 +1166,9 @@ impl StaticConfig {
);

for (j, ws) in m.workspaces_mut().iter_mut().enumerate() {
ws.load_static_config(
monitor
.workspaces
.get(j)
.expect("no static workspace config"),
)?;
if let Some(workspace_config) = monitor.workspaces.get(j) {
ws.load_static_config(workspace_config)?;
}
}
}

Expand Down

0 comments on commit 172988e

Please sign in to comment.