diff options
author | Mike Lundy <mike@fluffypenguin.org> | 2009-12-21 03:54:08 +0100 |
---|---|---|
committer | Mike Lundy <mike@fluffypenguin.org> | 2009-12-21 03:54:08 +0100 |
commit | 506a524dbb57a9f7fc9c43f989b8cff4bd595cac (patch) | |
tree | 54e1a89283b80d2dc7ff18cec1295178ade3e597 /XMonad | |
parent | 1c05da6f3230be66bc62184a72526338c1757877 (diff) | |
download | XMonadContrib-506a524dbb57a9f7fc9c43f989b8cff4bd595cac.tar.gz XMonadContrib-506a524dbb57a9f7fc9c43f989b8cff4bd595cac.tar.xz XMonadContrib-506a524dbb57a9f7fc9c43f989b8cff4bd595cac.zip |
Add a search predicate option to XMonad.Prompt
Ignore-this: 8e8804eeb9650d38bc225e15887310da
darcs-hash:20091221025408-88b46-c700aa5d2fdcad96495c23e53f51496be36cbc7c.gz
Diffstat (limited to 'XMonad')
-rw-r--r-- | XMonad/Prompt.hs | 9 | ||||
-rw-r--r-- | XMonad/Prompt/Window.hs | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/XMonad/Prompt.hs b/XMonad/Prompt.hs index a8646e1..087da9f 100644 --- a/XMonad/Prompt.hs +++ b/XMonad/Prompt.hs @@ -138,7 +138,10 @@ data XPConfig = , defaultText :: String -- ^ The text by default in the prompt line , autoComplete :: Maybe Int -- ^ Just x: if only one completion remains, auto-select it, , showCompletionOnTab :: Bool -- ^ Only show list of completions when Tab was pressed - -- and delay by x microseconds + -- and delay by x microseconds + , searchPredicate :: String -> String -> Bool + -- ^ Given the typed string and a possible + -- completion, is the completion valid? } data XPType = forall p . XPrompt p => XPT p @@ -212,7 +215,9 @@ defaultXPConfig = , historyFilter = id , defaultText = [] , autoComplete = Nothing - , showCompletionOnTab = False } + , showCompletionOnTab = False + , searchPredicate = isPrefixOf + } greenXPConfig = defaultXPConfig { fgColor = "green", bgColor = "black" } amberXPConfig = defaultXPConfig { fgColor = "#ca8f2d", bgColor = "black", fgHLight = "#eaaf4c" } diff --git a/XMonad/Prompt/Window.hs b/XMonad/Prompt/Window.hs index 0f0ed2a..a5b6aeb 100644 --- a/XMonad/Prompt/Window.hs +++ b/XMonad/Prompt/Window.hs @@ -24,7 +24,6 @@ module XMonad.Prompt.Window ) where import qualified Data.Map as M -import Data.List import qualified XMonad.StackSet as W import XMonad @@ -89,7 +88,7 @@ doPrompt t c = do bringAction = winAction bringWindow bringCopyAction = winAction bringCopyWindow - compList m s = return . filter (isPrefixOf s) . map fst . M.toList $ m + compList m s = return . filter (searchPredicate c s) . map fst . M.toList $ m -- | Brings a copy of the specified window into the current workspace. |