ENH don't flag key entries with !!!

This commit is contained in:
Nathan Dwarshuis 2022-07-08 20:08:17 -04:00
parent 7ad7b8960e
commit c8109a9e66
1 changed files with 5 additions and 6 deletions

View File

@ -598,12 +598,11 @@ evalKeyBinding k@KeyBinding { kbMaybeAction = a } =
filterExternal :: [KeyGroup MaybeX] -> [KeyGroup (X ())]
filterExternal = fmap go
where
go k@KeyGroup { kgBindings = bs } = k { kgBindings = mapMaybe flagKeyBinding bs }
flagKeyBinding :: KeyBinding MaybeX -> Maybe (KeyBinding (X ()))
flagKeyBinding k@KeyBinding{ kbDesc = d, kbMaybeAction = a } = case a of
(Just x) -> Just $ k{ kbMaybeAction = x }
Nothing -> Just $ k{ kbDesc = "[!!!]" ++ d, kbMaybeAction = skip }
go k@KeyGroup { kgBindings = bs } =
k { kgBindings = [ kb { kbMaybeAction = x }
| kb@KeyBinding { kbMaybeAction = Just x } <- bs
]
}
externalBindings :: ThreadState -> DBusState -> [KeyGroup FeatureX]
externalBindings ts db =