From 47b48253030912c36cf77bc5179e6e5fdcc152c3 Mon Sep 17 00:00:00 2001 From: gwern0 Date: Wed, 8 Oct 2008 22:47:10 +0200 Subject: 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 --- XMonad/Prompt.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'XMonad/Prompt.hs') 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. -- cgit v1.2.3