diff --git a/CHANGES.md b/CHANGES.md index a29f99c1..93b68e18 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -51,8 +51,10 @@ * `XMonad.Actions.Search` - The `hoogle` function now uses the new URL `hoogle.haskell.org`. - + - The `hoogle` function now uses the new URL `hoogle.haskell.org`. + - Added `promptSearchBrowser'` function to only suggest previous searches of + the selected search engine (instead of all search engines). + * `XMonad.Layout.BoringWindows` Added 'markBoringEverywhere' function, to mark the currently diff --git a/XMonad/Actions/Search.hs b/XMonad/Actions/Search.hs index 7a7bf8b1..8c5c6c7e 100644 --- a/XMonad/Actions/Search.hs +++ b/XMonad/Actions/Search.hs @@ -18,6 +18,7 @@ module XMonad.Actions.Search ( -- * Usage searchEngineF, promptSearch, promptSearchBrowser, + promptSearchBrowser', selectSearch, selectSearchBrowser, isPrefixOf, @@ -361,6 +362,18 @@ promptSearchBrowser :: XPConfig -> Browser -> SearchEngine -> X () promptSearchBrowser config browser (SearchEngine name site) = mkXPrompt (Search name) config (historyCompletionP ("Search [" `isPrefixOf`)) $ search browser site +{- | Like 'promptSearchBrowser', but only suggest previous searches for the + given 'SearchEngine' in the prompt. -} +promptSearchBrowser' :: XPConfig -> Browser -> SearchEngine -> X () +promptSearchBrowser' config browser (SearchEngine name site) = + mkXPrompt + (Search name) + config + (historyCompletionP (searchName `isPrefixOf`)) + $ search browser site + where + searchName = showXPrompt (Search name) + {- | Like 'search', but in this case, the string is not specified but grabbed from the user's response to a prompt. Example: