From bbe2537fa4631af71d73349f263c508ec38cda20 Mon Sep 17 00:00:00 2001 From: "c.lopez" Date: Sun, 26 Aug 2012 10:54:26 +0200 Subject: Improve comments, add an error throw that shouldn't happen Ignore-this: 7675070826b3c53499e4352e692d6036 darcs-hash:20120826085426-c3db2-648c1b82565fa87710737b641c8159ea257011d9.gz --- XMonad/Prompt.hs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'XMonad/Prompt.hs') diff --git a/XMonad/Prompt.hs b/XMonad/Prompt.hs index 2548a56..0ae657e 100644 --- a/XMonad/Prompt.hs +++ b/XMonad/Prompt.hs @@ -216,10 +216,12 @@ class XPrompt t where completionFunction :: t -> ComplFunction completionFunction t = \_ -> return ["Completions for " ++ (showXPrompt t) ++ " could not be loaded"] - -- | When the prompt has multiple modes, this function is called - -- when the user picked an item from the autocompletion list. - -- The first argument is the autocompleted item's text. - -- The second argument is the query made by the user (written in the prompt's buffer). + -- | When the prompt has multiple modes (created with mkXPromptWithModes), this function is called + -- when the user picks an item from the autocompletion list. + -- The first argument is the prompt (or mode) on which the item was picked + -- The first string argument is the autocompleted item's text. + -- The second string argument is the query made by the user (written in the prompt's buffer). + -- See XMonad/Actions/Launcher.hs for a usage example. modeAction :: t -> String -> String -> X () modeAction _ _ _ = return () @@ -434,7 +436,7 @@ mkXPromptWithModes modes conf = do XPMultipleModes ms -> let action = modeAction $ W.focus ms in action (command st') $ (fromMaybe "" $ highlightedCompl st') - _ -> return () --This should never happen, we are creating a prompt with multiple modes, so its operationMode should have been constructed with XPMultipleMode + _ -> error "The impossible occurred: This prompt runs with multiple modes but they could not be found." --we are creating a prompt with multiple modes, so its operationMode should have been constructed with XPMultipleMode else return () -- cgit v1.2.3