mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-17 05:03:55 -07:00
use 'take 1' instead of custom truncHead function in L.WindowNavigation
This commit is contained in:
@@ -130,7 +130,7 @@ instance LayoutModifier WindowNavigation Window where
|
|||||||
(\d -> take 1 $ navigable d pt wrs) [U,D,R,L]
|
(\d -> take 1 $ navigable d pt wrs) [U,D,R,L]
|
||||||
wnavigablec = nub $ concatMap
|
wnavigablec = nub $ concatMap
|
||||||
(\d -> map (\(win,_) -> (win,dirc d)) $
|
(\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
|
wothers = case state of Just (NS _ wo) -> map fst wo
|
||||||
_ -> []
|
_ -> []
|
||||||
mapM_ (sc nbc) (wothers \\ map fst wnavigable)
|
mapM_ (sc nbc) (wothers \\ map fst wnavigable)
|
||||||
@@ -192,10 +192,6 @@ instance LayoutModifier WindowNavigation Window where
|
|||||||
navigable :: Direction -> Point -> [(Window, Rectangle)] -> [(Window, Rectangle)]
|
navigable :: Direction -> Point -> [(Window, Rectangle)] -> [(Window, Rectangle)]
|
||||||
navigable d pt = sortby d . filter (inr d pt . snd)
|
navigable d pt = sortby d . filter (inr d pt . snd)
|
||||||
|
|
||||||
truncHead :: [a] -> [a]
|
|
||||||
truncHead (x:_) = [x]
|
|
||||||
truncHead [] = []
|
|
||||||
|
|
||||||
sc :: Pixel -> Window -> X ()
|
sc :: Pixel -> Window -> X ()
|
||||||
sc c win = withDisplay $ \dpy -> io $ setWindowBorder dpy win c
|
sc c win = withDisplay $ \dpy -> io $ setWindowBorder dpy win c
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user