Merge pull request #330 from slotThe/master

X.A.Search: Add promptSearchBrowser'
This commit is contained in:
Brent Yorgey
2020-02-14 17:59:10 -06:00
committed by GitHub
2 changed files with 17 additions and 2 deletions

View File

@@ -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

View File

@@ -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: