From 506a524dbb57a9f7fc9c43f989b8cff4bd595cac Mon Sep 17 00:00:00 2001 From: Mike Lundy Date: Mon, 21 Dec 2009 03:54:08 +0100 Subject: Add a search predicate option to XMonad.Prompt Ignore-this: 8e8804eeb9650d38bc225e15887310da darcs-hash:20091221025408-88b46-c700aa5d2fdcad96495c23e53f51496be36cbc7c.gz --- XMonad/Prompt.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'XMonad/Prompt.hs') 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" } -- cgit v1.2.3