mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
Use lookup instead of find in A.PerWorkspaceKeys
This commit is contained in:
parent
de3cafec0d
commit
84a8e42ac0
@ -21,7 +21,6 @@ module XMonad.Actions.PerWorkspaceKeys (
|
|||||||
|
|
||||||
import XMonad
|
import XMonad
|
||||||
import XMonad.StackSet as S
|
import XMonad.StackSet as S
|
||||||
import Data.List (find)
|
|
||||||
|
|
||||||
-- $usage
|
-- $usage
|
||||||
--
|
--
|
||||||
@ -42,9 +41,9 @@ chooseAction f = withWindowSet (f . S.currentTag)
|
|||||||
-- If it isn't listed, then run default action (marked with empty string, \"\"), or do nothing if default isn't supplied.
|
-- If it isn't listed, then run default action (marked with empty string, \"\"), or do nothing if default isn't supplied.
|
||||||
bindOn :: [(String, X())] -> X()
|
bindOn :: [(String, X())] -> X()
|
||||||
bindOn bindings = chooseAction chooser where
|
bindOn bindings = chooseAction chooser where
|
||||||
chooser ws = case find ((ws==).fst) bindings of
|
chooser ws = case lookup ws bindings of
|
||||||
Just (_, action) -> action
|
Just action -> action
|
||||||
Nothing -> case find ((""==).fst) bindings of
|
Nothing -> case lookup "" bindings of
|
||||||
Just (_, action) -> action
|
Just action -> action
|
||||||
Nothing -> return ()
|
Nothing -> return ()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user