aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad
diff options
context:
space:
mode:
authorgwern0 <gwern0@gmail.com>2008-10-08 22:47:10 +0200
committergwern0 <gwern0@gmail.com>2008-10-08 22:47:10 +0200
commit47b48253030912c36cf77bc5179e6e5fdcc152c3 (patch)
tree8580ea2123cc21bf2cbd24501dfa387be82173cc /XMonad
parent5b6e5ef78c4114dcf4c4c289ed32795aa2efdb67 (diff)
downloadXMonadContrib-47b48253030912c36cf77bc5179e6e5fdcc152c3.tar.gz
XMonadContrib-47b48253030912c36cf77bc5179e6e5fdcc152c3.tar.xz
XMonadContrib-47b48253030912c36cf77bc5179e6e5fdcc152c3.zip
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. darcs-hash:20081008204710-f7719-8c632a07157561942056dd2f7293a9b005eb2c12.gz
Diffstat (limited to 'XMonad')
-rw-r--r--XMonad/Prompt.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/XMonad/Prompt.hs b/XMonad/Prompt.hs
index 8244e85..c01e3cb 100644
--- a/XMonad/Prompt.hs
+++ b/XMonad/Prompt.hs
@@ -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.