From 31ae98bcc9158787eb264a0bc84b25dc10351928 Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Sat, 16 Feb 2008 14:38:42 +0100 Subject: Prompt.Window: remove unneeded and ugly escaping/unescaping darcs-hash:20080216133842-32816-e47eca7967f6fd2134473fc9114113d744a0a57a.gz --- XMonad/Prompt/Window.hs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'XMonad/Prompt/Window.hs') diff --git a/XMonad/Prompt/Window.hs b/XMonad/Prompt/Window.hs index b4f6656..cf34fdd 100644 --- a/XMonad/Prompt/Window.hs +++ b/XMonad/Prompt/Window.hs @@ -50,8 +50,10 @@ import XMonad.Actions.WindowBringer data WindowPrompt = Goto | Bring instance XPrompt WindowPrompt where - showXPrompt Goto = "Go to window: " - showXPrompt Bring = "Bring me here: " + showXPrompt Goto = "Go to window: " + showXPrompt Bring = "Bring me here: " + commandToComplete _ c = c + nextCompletion _ = getNextCompletion windowPromptGoto, windowPromptBring :: XPConfig -> X () windowPromptGoto c = doPrompt Goto c @@ -69,17 +71,9 @@ doPrompt t c = do where - winAction a m = flip whenJust (windows . a) . flip M.lookup m . unescape + winAction a m = flip whenJust (windows . a) . flip M.lookup m gotoAction = winAction W.greedyView bringAction = winAction bringWindow bringWindow w ws = W.shiftWin (W.tag . W.workspace . W.current $ ws) w ws - compList m s = return . filter (isPrefixOf s) . map (escape . fst) . M.toList $ m - - escape [] = [] - escape (' ':xs) = "\\ " ++ escape xs - escape (x :xs) = x : escape xs - - unescape [] = [] - unescape ('\\':' ':xs) = ' ' : unescape xs - unescape (x:xs) = x : unescape xs + compList m s = return . filter (isPrefixOf s) . map fst . M.toList $ m -- cgit v1.2.3