From cfb0c7f2ce760b9d27232b8293e35638f049c03a Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 25 May 2024 20:34:57 -0700 Subject: [PATCH] feat(wm): allow stack expansion in direction This commit allows for the user to expand container stacks while focused on an an existing (len > 1) container stack by using the stack command with a desired direction. resolve #847 --- komorebi/src/window_manager.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/komorebi/src/window_manager.rs b/komorebi/src/window_manager.rs index d61ea445..cef40c55 100644 --- a/komorebi/src/window_manager.rs +++ b/komorebi/src/window_manager.rs @@ -1503,7 +1503,15 @@ impl WindowManager { new_idx }; - workspace.move_window_to_container(adjusted_new_index)?; + if let Some(current) = workspace.focused_container() { + if current.windows().len() > 1 { + workspace.focus_container(adjusted_new_index); + workspace.move_window_to_container(current_container_idx)?; + } else { + workspace.move_window_to_container(adjusted_new_index)?; + } + } + self.update_focused_workspace(self.mouse_follows_focus, false)?; }