Skip to content

Commit

Permalink
remember workspace in appropriate commands
Browse files Browse the repository at this point in the history
  • Loading branch information
thrombe committed Apr 24, 2024
1 parent eb1c848 commit 49b891d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ impl Command {
let workspace = Workspace::get_active_async().await?;
let a = match &self {
Command::SwitchToActivity { name, move_window } => {
state.remember_workspace(&workspace);
Some((name.clone(), *move_window))
}
Command::NextActivity { cycle, move_window } => {
Expand Down Expand Up @@ -185,6 +186,7 @@ impl Command {
})
.unwrap_or(0);
let a = state.activities[i].clone();
state.remember_workspace(&workspace);
Some((a, *move_window))
}
Command::SetNamedFocus { name } => {
Expand All @@ -210,6 +212,15 @@ impl Command {
.await?;
return Ok(());
}
Command::SwitchNamedFocus { name, move_window } => {
if let Some(name) = state.named_focii.get(name) {
let name = name.to_owned();
state.remember_workspace(&workspace);
Some((name, *move_window))
} else {
None
}
}
_ => None,
};

Expand Down Expand Up @@ -295,7 +306,6 @@ impl Command {
} else {
name = state.workspaces[new_activity_index][0].clone();
};
state.remember_workspace(&workspace);
state
.move_to_workspace(&name, move_window, Animation::Fade)
.await?;
Expand Down Expand Up @@ -324,7 +334,6 @@ impl Command {
} else {
name = state.workspaces[activity_index][0].clone();
};
state.remember_workspace(&workspace);
state
.move_to_workspace(&name, move_window, Animation::Fade)
.await?;
Expand Down

0 comments on commit 49b891d

Please sign in to comment.