Skip to content

Commit

Permalink
Fix bug: list-workspaces --focused should return only visible workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitabobko committed Oct 13, 2024
1 parent 19a2df8 commit 2c3924f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Sources/Common/cmdArgs/impl/ListWorkspacesCmdArgs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,12 @@ public func parseListWorkspacesCmdArgs(_ args: [String]) -> ParsedCmd<ListWorksp
.map { raw in
raw.all ? raw.copy(\.filteringOptions.onMonitors, [.all]).copy(\.all, false) : raw
}
.map { raw in
raw.focused ? raw.copy(\.filteringOptions.onMonitors, [.focused]).copy(\.focused, false) : raw
.map { raw in // Expand alias
raw.focused
? raw.copy(\.filteringOptions.onMonitors, [.focused])
.copy(\.filteringOptions.visible, true)
.copy(\.focused, false)
: raw
}
.flatMap { if $0.json, let msg = getErrorIfFormatIsIncompatibleWithJson($0._format) { .failure(msg) } else { .cmd($0) } }
}
Expand Down

0 comments on commit 2c3924f

Please sign in to comment.