mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-31 20:21:51 -07:00
Reduce head usage
This commit is contained in:
@@ -27,7 +27,7 @@ module XMonad.Actions.OnScreen (
|
||||
) where
|
||||
|
||||
import XMonad
|
||||
import XMonad.Prelude (fromMaybe, guard)
|
||||
import XMonad.Prelude (fromMaybe, guard, empty)
|
||||
import XMonad.StackSet hiding (new)
|
||||
|
||||
|
||||
@@ -140,10 +140,9 @@ toggleOrView' f i st = fromMaybe (f i st) $ do
|
||||
let st' = hidden st
|
||||
-- make sure we actually have to do something
|
||||
guard $ i == (tag . workspace $ current st)
|
||||
guard $ not (null st')
|
||||
-- finally, toggle!
|
||||
return $ f (tag . head $ st') st
|
||||
|
||||
case st' of
|
||||
[] -> empty
|
||||
(h : _) -> return $ f (tag h) st -- finally, toggle!
|
||||
|
||||
-- $usage
|
||||
--
|
||||
|
Reference in New Issue
Block a user