aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Prompt.hs
diff options
context:
space:
mode:
authorc.lopez <c.lopez@kmels.net>2012-08-26 10:54:26 +0200
committerc.lopez <c.lopez@kmels.net>2012-08-26 10:54:26 +0200
commitbbe2537fa4631af71d73349f263c508ec38cda20 (patch)
tree1898ac85a0485a6f0cf0a224f666b394f2c357f9 /XMonad/Prompt.hs
parentc843d799140aacaf27cfadad545e485f35e1d385 (diff)
downloadXMonadContrib-bbe2537fa4631af71d73349f263c508ec38cda20.tar.gz
XMonadContrib-bbe2537fa4631af71d73349f263c508ec38cda20.tar.xz
XMonadContrib-bbe2537fa4631af71d73349f263c508ec38cda20.zip
Improve comments, add an error throw that shouldn't happen
Ignore-this: 7675070826b3c53499e4352e692d6036 darcs-hash:20120826085426-c3db2-648c1b82565fa87710737b641c8159ea257011d9.gz
Diffstat (limited to '')
-rw-r--r--XMonad/Prompt.hs12
1 files changed, 7 insertions, 5 deletions
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 ()