From 0db1faa1c5710bbd872ee4ed9f5d885a703a76f6 Mon Sep 17 00:00:00 2001 From: Nabos Date: Tue, 17 Jan 2023 15:47:27 +0100 Subject: [PATCH] Check group index lower limit --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 67c9a31..ffaa809 100644 --- a/src/main.rs +++ b/src/main.rs @@ -413,6 +413,7 @@ fn focus_to_group(stream: &UnixStream, group_index: usize) { current_workspace_index - (current_workspace_index / 10) * 10; let target_workspace_index = group_index * 10 + contextual_target_workspace_index; + println!("{target_workspace_index}"); // If the workspace already exists match workspaces.iter().find(|w| w.num == target_workspace_index) { @@ -435,7 +436,7 @@ fn focus_to_group(stream: &UnixStream, group_index: usize) { ), None => { // Or if the targeted output is currently connected - if group_index <= outputs.len() { + if group_index != 0 && group_index <= outputs.len() { Some(group_index) } else { None