From aec21860bae7c810f3aee32fcae72521a07d93f3 Mon Sep 17 00:00:00 2001 From: Ulrik de Muelenaere Date: Thu, 15 Feb 2024 19:55:47 -0500 Subject: [PATCH] X.U.EZConfig: Fix checkKeymap warning that all keybindings are duplicate This reverts part of 42179b8625d83b2cd3c3a35da84de6f6c0dea6d6, which effectively changed the duplicate check from >1 to >=1. --- CHANGES.md | 4 ++++ XMonad/Util/EZConfig.hs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index dbc212962..0bfce0d05 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,10 @@ * Fix build-with-cabal.sh when XDG_CONFIG_HOME is defined. + * `XMonad.Util.EZConfig` + + - Fixed `checkKeymap` warning that all keybindings are duplicates. + ### Other changes ## 0.18.0 (February 3, 20 diff --git a/XMonad/Util/EZConfig.hs b/XMonad/Util/EZConfig.hs index e0753f714..1b3aa369d 100644 --- a/XMonad/Util/EZConfig.hs +++ b/XMonad/Util/EZConfig.hs @@ -552,8 +552,8 @@ doKeymapCheck :: XConfig l -> [(String,a)] -> ([String], [String]) doKeymapCheck conf km = (bad,dups) where ks = map ((readKeySequence conf &&& id) . fst) km bad = nub . map snd . filter (isNothing . fst) $ ks - dups = map (snd . NE.head) - . mapMaybe nonEmpty + dups = map (snd . NE.head . notEmpty) + . filter ((>1) . length) . groupBy ((==) `on` fst) . sortBy (comparing fst) . map (first fromJust)