mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-03 05:31:53 -07:00
Use io instead of liftIO in Prompt
This commit is contained in:
@@ -270,23 +270,23 @@ mkXPromptWithReturn t conf compl action = do
|
|||||||
let d = display c
|
let d = display c
|
||||||
rw = theRoot c
|
rw = theRoot c
|
||||||
s <- gets $ screenRect . W.screenDetail . W.current . windowset
|
s <- gets $ screenRect . W.screenDetail . W.current . windowset
|
||||||
hist <- liftIO readHistory
|
hist <- io readHistory
|
||||||
w <- liftIO $ createWin d rw conf s
|
w <- io $ createWin d rw conf s
|
||||||
liftIO $ selectInput d w $ exposureMask .|. keyPressMask
|
io $ selectInput d w $ exposureMask .|. keyPressMask
|
||||||
gc <- liftIO $ createGC d w
|
gc <- io $ createGC d w
|
||||||
liftIO $ setGraphicsExposures d gc False
|
io $ setGraphicsExposures d gc False
|
||||||
fs <- initXMF (font conf)
|
fs <- initXMF (font conf)
|
||||||
numlock <- asks $ X.numlockMask . X.config
|
numlock <- asks $ X.numlockMask . X.config
|
||||||
let hs = fromMaybe [] $ M.lookup (showXPrompt t) hist
|
let hs = fromMaybe [] $ M.lookup (showXPrompt t) hist
|
||||||
st = (initState d rw w s compl gc fs (XPT t) hs conf)
|
st = (initState d rw w s compl gc fs (XPT t) hs conf)
|
||||||
{ numlockMask = numlock }
|
{ numlockMask = numlock }
|
||||||
st' <- liftIO $ execStateT runXP st
|
st' <- io $ execStateT runXP st
|
||||||
|
|
||||||
releaseXMF fs
|
releaseXMF fs
|
||||||
liftIO $ freeGC d gc
|
io $ freeGC d gc
|
||||||
if successful st'
|
if successful st'
|
||||||
then do
|
then do
|
||||||
liftIO $ writeHistory $ M.insertWith
|
io $ writeHistory $ M.insertWith
|
||||||
(\xs ys -> take (historySize conf)
|
(\xs ys -> take (historySize conf)
|
||||||
. historyFilter conf $ xs ++ ys)
|
. historyFilter conf $ xs ++ ys)
|
||||||
(showXPrompt t) (historyFilter conf [command st'])
|
(showXPrompt t) (historyFilter conf [command st'])
|
||||||
|
Reference in New Issue
Block a user