From 3bbd8dad703e3d3edae581f3825396fcdaccf734 Mon Sep 17 00:00:00 2001 From: Martin Myrseth Date: Wed, 9 Oct 2024 14:56:37 +0200 Subject: [PATCH] fix(rofi): Don't strip key lookup There might be trailing whitespace (not newlines) in the keys of the selection lookup map. --- src/Nixon/Backend/Rofi.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nixon/Backend/Rofi.hs b/src/Nixon/Backend/Rofi.hs index 804197a..6349cbf 100644 --- a/src/Nixon/Backend/Rofi.hs +++ b/src/Nixon/Backend/Rofi.hs @@ -146,7 +146,7 @@ rofi opts candidates = do map' <- Map.fromList . fmap (Select.candidate_title &&& Select.candidate_value) <$> shell_to_list candidates (code, out) <- procStrict "rofi" args (toLines $ select $ Map.keys map') - let out' = (fmap (flip Map.lookup map' . T.strip) . T.lines) out + let out' = (fmap (`Map.lookup` map') . T.lines) out pure $ case code of ExitSuccess -> mkselection Default out' ExitFailure 1 -> CanceledSelection