Skip to content

Commit

Permalink
mru -> mostRecent
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitabobko committed Sep 17, 2023
1 parent 162830b commit d06b949
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/command/FocusCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct FocusCommand: Command {

func run() async {
precondition(Thread.current.isMainThread)
guard let window = NSWorkspace.focusedApp?.macApp?.focusedWindow ?? Workspace.focused.mruWindows.mru else { return }
guard let window = NSWorkspace.focusedApp?.macApp?.focusedWindow ?? Workspace.focused.mruWindows.mostRecent else { return }
if let direction = direction.direction {
let orientation = direction.orientation
guard let topMostChild = window.parentsWithSelf.lazy.first(where: {
Expand Down
2 changes: 1 addition & 1 deletion src/command/WorkspaceCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct WorkspaceCommand : Command {
static func switchToWorkspace(_ workspace: Workspace) {
debug("Switch to workspace: \(workspace.name)")
refresh(endSession: false)
if let window = workspace.mruWindows.mru ?? workspace.anyLeafWindowRecursive { // switch to not empty workspace
if let window = workspace.mruWindows.mostRecent ?? workspace.anyLeafWindowRecursive { // switch to not empty workspace
window.focus()
// The switching itself will be done by refreshWorkspaces and layoutWorkspaces later in refresh
} else { // switch to empty workspace
Expand Down
2 changes: 1 addition & 1 deletion src/tree/MacWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class MacWindow: TreeNode, Hashable {
parent = workspace
weight = FLOATING_ADAPTIVE_WEIGHT
} else {
let tilingParent = workspace.mruWindows.mru?.parent as? TilingContainer ?? workspace.rootTilingContainer
let tilingParent = workspace.mruWindows.mostRecent?.parent as? TilingContainer ?? workspace.rootTilingContainer
parent = tilingParent
weight = parent.children.sumOf { $0.getWeight(tilingParent.orientation) }
.div(parent.children.count) ?? 1
Expand Down
2 changes: 1 addition & 1 deletion src/util/MruStack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct MruStack<T: Equatable>: Sequence {
MruStackIterator(mruNode)
}

var mru: T? { mruNode?.value }
var mostRecent: T? { mruNode?.value }

mutating func pushOrRaise(_ value: T) {
remove(value)
Expand Down

0 comments on commit d06b949

Please sign in to comment.