use 'take 1' instead of custom truncHead function in L.WindowNavigation

This commit is contained in:
Adam Vogt
2009-06-18 01:01:18 +00:00
parent cc84480c99
commit 00c3775a06

View File

@@ -130,7 +130,7 @@ instance LayoutModifier WindowNavigation Window where
(\d -> take 1 $ navigable d pt wrs) [U,D,R,L]
wnavigablec = nub $ concatMap
(\d -> map (\(win,_) -> (win,dirc d)) $
truncHead $ navigable d pt wrs) [U,D,R,L]
take 1 $ navigable d pt wrs) [U,D,R,L]
wothers = case state of Just (NS _ wo) -> map fst wo
_ -> []
mapM_ (sc nbc) (wothers \\ map fst wnavigable)
@@ -192,10 +192,6 @@ instance LayoutModifier WindowNavigation Window where
navigable :: Direction -> Point -> [(Window, Rectangle)] -> [(Window, Rectangle)]
navigable d pt = sortby d . filter (inr d pt . snd)
truncHead :: [a] -> [a]
truncHead (x:_) = [x]
truncHead [] = []
sc :: Pixel -> Window -> X ()
sc c win = withDisplay $ \dpy -> io $ setWindowBorder dpy win c