Skip to content

Commit

Permalink
fix(rofi): Don't strip key lookup
Browse files Browse the repository at this point in the history
There might be trailing whitespace (not newlines) in the keys of the
selection lookup map.
  • Loading branch information
myme committed Oct 9, 2024
1 parent bc5391a commit 3bbd8da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Nixon/Backend/Rofi.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3bbd8da

Please sign in to comment.