don't reorganise if workspace has open vscode
This commit is contained in:
parent
efd2dd8f34
commit
6b409dfe18
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -1,6 +1,6 @@
|
||||||
# This file is automatically @generated by Cargo.
|
# This file is automatically @generated by Cargo.
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
version = 3
|
version = 4
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "addr2line"
|
name = "addr2line"
|
||||||
|
@ -1041,7 +1041,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sway-flash-indicator"
|
name = "sway-flash-indicator"
|
||||||
version = "0.6.4"
|
version = "0.6.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"directories",
|
"directories",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "sway-flash-indicator"
|
name = "sway-flash-indicator"
|
||||||
version = "0.6.4"
|
version = "0.6.5"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
12
src/main.rs
12
src/main.rs
|
@ -221,6 +221,18 @@ async fn code_trigger<T: AsRef<str> + std::cmp::PartialEq<str>>(
|
||||||
return Ok(());
|
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 {
|
while workspace.focus.len() == 1 {
|
||||||
workspace = get_with_id(workspace, workspace.focus[0])?;
|
workspace = get_with_id(workspace, workspace.focus[0])?;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue