mirror of
https://github.com/xmonad/xmonad.git
synced 2025-09-01 19:33:46 -07:00
rework failure cases in StackSet.view
This commit is contained in:
@@ -210,8 +210,7 @@ new _ _ _ = abort "non-positive argument to StackSet.new"
|
||||
|
||||
view :: (Eq s, Eq i) => i -> StackSet i l a s sd -> StackSet i l a s sd
|
||||
view i s
|
||||
| not (i `tagMember` s)
|
||||
|| i == tag (workspace (current s)) = s -- out of bounds or current
|
||||
| i == tag (workspace (current s)) = s -- current
|
||||
|
||||
| Just x <- L.find ((i==).tag.workspace) (visible s)
|
||||
-- if it is visible, it is just raised
|
||||
@@ -222,7 +221,7 @@ view i s
|
||||
= s { current = (current s) { workspace = x }
|
||||
, hidden = workspace (current s) : L.deleteBy (equating tag) x (hidden s) }
|
||||
|
||||
| otherwise = s -- can't happen: all workspaces are either invalid, current, visible, or hidden
|
||||
| otherwise = s -- not a member of the stackset
|
||||
|
||||
where equating f = \x y -> f x == f y
|
||||
|
||||
|
Reference in New Issue
Block a user