mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 03:20:21 -07:00
Prompt.hs: have historyCompletion filter dupes
Specifically, it calls deleteConsecutiveDuplicates on the end product. uniqSort reverses order in an unfortunate way, so we don't use that. The use-case is when a user has added the same input many times - as it stands, if the history records 30 'top's or whatever, the completion will show 30 'top' entries! This fixes that.
This commit is contained in:
parent
a0ac6331df
commit
c27eb22b39
@ -811,7 +811,7 @@ breakAtSpace s
|
||||
-- 'getShellCompl'; you pass it to mkXPrompt, and it will make completions work
|
||||
-- from the query history stored in ~\/.xmonad\/history.
|
||||
historyCompletion :: ComplFunction
|
||||
historyCompletion x = fmap (filter (isInfixOf x) . Map.fold (++) []) readHistory
|
||||
historyCompletion x = fmap (deleteConsecutiveDuplicates . filter (isInfixOf x) . Map.fold (++) []) readHistory
|
||||
|
||||
-- | Sort a list and remove duplicates. Like 'deleteAllDuplicates', but trades off
|
||||
-- laziness and stability for efficiency.
|
||||
|
Loading…
x
Reference in New Issue
Block a user