mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 03:20:21 -07:00
RotView.rotView: use Data.Ord.comparing.
Looks a bit cleaner than '\x y -> compare (tag x) (tag y)'
This commit is contained in:
parent
517e3417a7
commit
b8edd5997f
@ -21,6 +21,7 @@ module XMonadContrib.RotView (
|
||||
import Control.Monad.State ( gets )
|
||||
import Data.List ( sortBy )
|
||||
import Data.Maybe ( listToMaybe, isJust )
|
||||
import Data.Ord ( comparing )
|
||||
|
||||
import XMonad
|
||||
import StackSet hiding (filter)
|
||||
@ -38,7 +39,7 @@ rotView :: Bool -> X ()
|
||||
rotView b = do
|
||||
ws <- gets windowset
|
||||
let m = tag . workspace . current $ ws
|
||||
sortWs = sortBy (\x y -> compare (tag x) (tag y))
|
||||
sortWs = sortBy (comparing tag)
|
||||
pivoted = uncurry (flip (++)) . span ((< m) . tag) . sortWs . hidden $ ws
|
||||
nextws = listToMaybe . filter (isJust . stack) . (if b then id else reverse) $ pivoted
|
||||
whenJust nextws (O.view . tag)
|
||||
|
Loading…
x
Reference in New Issue
Block a user