mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-06 07:01:52 -07:00
Cleanup of shift code
This commit is contained in:
@@ -487,7 +487,7 @@ swapMaster = modify' $ \c -> case c of
|
|||||||
-- element on the current stack, the original stackSet is returned.
|
-- element on the current stack, the original stackSet is returned.
|
||||||
--
|
--
|
||||||
shift :: (Ord a, Eq s, Integral i) => i -> StackSet i a s sd -> StackSet i a s sd
|
shift :: (Ord a, Eq s, Integral i) => i -> StackSet i a s sd -> StackSet i a s sd
|
||||||
shift n s = if and [n >= 0,n `tagMember` s, n /= tag (workspace (current s))]
|
shift n s = if n >= 0 && n `tagMember` s && n /= curtag
|
||||||
then maybe s go (peek s) else s
|
then maybe s go (peek s) else s
|
||||||
where go w = foldr ($) s [view (tag (workspace (current s))),insertUp w,view n,delete w]
|
where go w = view curtag . insertUp w . view n . delete w $ s
|
||||||
-- ^^ poor man's state monad :-)
|
curtag = tag (workspace (current s))
|
||||||
|
Reference in New Issue
Block a user