Remove NamedFieldPuns from L.LimitWindows

This is more ugly, but otherwise we have lots of trouble for ghc-6.8
compatibility (due to the recomended flag having changed)
This commit is contained in:
Adam Vogt 2009-10-15 01:01:23 +00:00
parent d330dcae24
commit ca29a33f56

View File

@ -1,4 +1,4 @@
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, DeriveDataTypeable, NamedFieldPuns, PatternGuards #-} {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, DeriveDataTypeable, PatternGuards #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : XMonad.Layout.LimitWindows -- Module : XMonad.Layout.LimitWindows
@ -128,27 +128,27 @@ instance LayoutModifier Selection a where
Nothing Nothing
select :: Selection l -> W.Stack a -> W.Stack a select :: Selection l -> W.Stack a -> W.Stack a
select (Sel { nMaster, start, nRest }) stk select s stk
| lups < nMaster | lups < nMaster s
= stk { W.down=take (nMaster - lups - 1) downs ++ = stk { W.down=take (nMaster s - lups - 1) downs ++
(take nRest . drop (start - lups - 1) $ downs) } (take (nRest s) . drop (start s - lups - 1) $ downs) }
| otherwise | otherwise
= stk { W.up=reverse (take nMaster ups ++ drop start ups), = stk { W.up=reverse (take (nMaster s) ups ++ drop (start s) ups),
W.down=take (nRest - (lups - start) - 1) downs } W.down=take ((nRest s) - (lups - start s) - 1) downs }
where where
downs = W.down stk downs = W.down stk
ups = reverse $ W.up stk ups = reverse $ W.up stk
lups = length ups lups = length ups
updateStart :: Selection l -> W.Stack a -> Int updateStart :: Selection l -> W.Stack a -> Int
updateStart (Sel { nMaster, start, nRest }) stk updateStart s stk
| lups < nMaster -- the focussed window is in the master pane | lups < nMaster s -- the focussed window is in the master pane
= start `min` (lups + ldown - nRest + 1) `max` nMaster = start s `min` (lups + ldown - (nRest s) + 1) `max` nMaster s
| otherwise | otherwise
= start `min` lups = start s `min` lups
`max` (lups - nRest + 1) `max` (lups - (nRest s) + 1)
`min` (lups + ldown - nRest + 1) `min` (lups + ldown - (nRest s) + 1)
`max` nMaster `max` nMaster s
where where
lups = length $ W.up stk lups = length $ W.up stk
ldown = length $ W.down stk ldown = length $ W.down stk