aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Prompt.hs
diff options
context:
space:
mode:
Diffstat (limited to 'XMonad/Prompt.hs')
-rw-r--r--XMonad/Prompt.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/XMonad/Prompt.hs b/XMonad/Prompt.hs
index b624ad8..1a0edb3 100644
--- a/XMonad/Prompt.hs
+++ b/XMonad/Prompt.hs
@@ -391,14 +391,16 @@ keyPressHandle mask (ks,_)
where
go = updateWindows >> eventLoop handle
quit = flushString >> setSuccess False -- quit and discard everything
- setSuccess b = modify $ \s -> s { successful = b }
-- insert a character
keyPressHandle _ (_,s)
| s == "" = eventLoop handle
| otherwise = do insertString (decodeInput s)
updateWindows
completed <- tryAutoComplete
- unless completed $ eventLoop handle
+ if completed then setSuccess True else eventLoop handle
+
+setSuccess :: Bool -> XP ()
+setSuccess b = modify $ \s -> s { successful = b }
-- KeyPress and State