aboutsummaryrefslogtreecommitdiffstats
path: root/RotView.hs
diff options
context:
space:
mode:
authorDavid Roundy <droundy@darcs.net>2007-06-12 17:12:09 +0200
committerDavid Roundy <droundy@darcs.net>2007-06-12 17:12:09 +0200
commit1af7582b30d70ded97db92a69673849372c98fb9 (patch)
treef5e17574f1edd760920041bb551f02443046ae03 /RotView.hs
parent11f2eae73be71fd0b810966fdb5fec22d856e6c9 (diff)
downloadXMonadContrib-1af7582b30d70ded97db92a69673849372c98fb9.tar.gz
XMonadContrib-1af7582b30d70ded97db92a69673849372c98fb9.tar.xz
XMonadContrib-1af7582b30d70ded97db92a69673849372c98fb9.zip
changes to work with Stacks that can't be empty.
darcs-hash:20070612151209-72aca-62307f8565fc32ca80be8daf2c30fe414d49111e.gz
Diffstat (limited to 'RotView.hs')
-rw-r--r--RotView.hs9
1 files changed, 2 insertions, 7 deletions
diff --git a/RotView.hs b/RotView.hs
index 1fc421e..6a8fc7f 100644
--- a/RotView.hs
+++ b/RotView.hs
@@ -10,7 +10,7 @@ module XMonadContrib.RotView ( rotView ) where
import Control.Monad.State ( gets )
import Data.List ( sortBy )
-import Data.Maybe ( listToMaybe )
+import Data.Maybe ( listToMaybe, isJust )
import XMonad
import StackSet hiding (filter)
@@ -22,10 +22,5 @@ rotView b = do
let m = tag . workspace . current $ ws
sortWs = sortBy (\x y -> compare (tag x) (tag y))
pivoted = uncurry (flip (++)) . span ((< m) . tag) . sortWs . hidden $ ws
- nextws = listToMaybe . filter (not.isEmpty) . (if b then id else reverse) $ pivoted
+ nextws = listToMaybe . filter (isJust . stack) . (if b then id else reverse) $ pivoted
whenJust nextws (O.view . tag)
-
-isEmpty :: Workspace i a -> Bool
-isEmpty ws = case stack ws of
- Empty -> True
- _ -> False