Skip to content

Commit

Permalink
changing behaviour of the new workspace cycling methods to pull tags …
Browse files Browse the repository at this point in the history
…to the focused screen
  • Loading branch information
sminez committed Jun 2, 2024
1 parent 210f23d commit 66f8ca2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/pure/stack_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,24 +419,26 @@ where
// be present on it, but handling things this way means we avoid having any unwrapping or
// raw indexing into vecs.
if let Some(new_tag) = it.nth(1).or(tags.first()) {
self.focus_tag(new_tag)
self.pull_tag_to_screen(new_tag)
}
}

/// Move focus to the [Workspace] after the currently focused workspace as defined by their
/// position in [StackSet::ordered_workspaces].
///
/// As with the behaviour of [StackSet::focus_tag], if the next tag is on another screen then
/// focus will move to that screen rather than pulling the workspace to the active screen.
/// As with the behaviour of [StackSet::pull_tag_to_screen], if the next tag is on another
/// screen then it will be pulled to the active screen rather than focus moving to the screen
/// where the tag is currently located.
pub fn focus_next_workspace(&mut self) {
self.focus_adjacent_workspace(self.ordered_tags())
}

/// Move focus to the [Workspace] before the currently focused workspace as defined by their
/// position in [StackSet::ordered_workspaces].
///
/// As with the behaviour of [StackSet::focus_tag], if the next tag is on another screen then
/// focus will move to that screen rather than pulling the workspace to the active screen.
/// As with the behaviour of [StackSet::pull_tag_to_screen], if the next tag is on another
/// screen then it will be pulled to the active screen rather than focus moving to the screen
/// where the tag is currently located.
pub fn focus_previous_workspace(&mut self) {
let mut tags = self.ordered_tags();
tags.reverse();
Expand Down

0 comments on commit 66f8ca2

Please sign in to comment.