From 0b04e3ef93beace9ebe4e968c594b2c1dec72de8 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Thu, 25 Apr 2024 18:30:50 -0700 Subject: [PATCH] fix(wm): avoid out of range container focus op This commit ensures that when floating the sole window visible on a workspace that the focused container index for the workspace will not be decremented below 0. re #787 --- komorebi/src/workspace.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/komorebi/src/workspace.rs b/komorebi/src/workspace.rs index dec96f62..d0c4972f 100644 --- a/komorebi/src/workspace.rs +++ b/komorebi/src/workspace.rs @@ -876,7 +876,7 @@ impl Workspace { self.containers_mut().remove(focused_idx); self.resize_dimensions_mut().remove(focused_idx); - if focused_idx == self.containers().len() { + if focused_idx == self.containers().len() && focused_idx != 0 { self.focus_container(focused_idx - 1); } } else {