diff --git a/Cargo.lock b/Cargo.lock index 7664dc9..e324dfb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -1041,7 +1041,7 @@ dependencies = [ [[package]] name = "sway-flash-indicator" -version = "0.6.4" +version = "0.6.5" dependencies = [ "directories", "futures-util", diff --git a/Cargo.toml b/Cargo.toml index a98123b..b8369a2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sway-flash-indicator" -version = "0.6.4" +version = "0.6.5" edition = "2021" [dependencies] diff --git a/src/main.rs b/src/main.rs index 0200c16..009b094 100644 --- a/src/main.rs +++ b/src/main.rs @@ -221,6 +221,18 @@ async fn code_trigger + std::cmp::PartialEq>( return Ok(()); } + if workspace + .find_as_ref(|n| { + n.app_id + .as_ref() + .is_some_and(|app_id| app_id.starts_with("code") && n.id != id) + }) + .is_some() + { + // don't reorganise if this workspace already has a vscode window + return Ok(()); + } + while workspace.focus.len() == 1 { workspace = get_with_id(workspace, workspace.focus[0])?; }