summaryrefslogtreecommitdiff
path: root/Pancake.hs
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2017-12-15 17:17:57 +0300
committerdefanor <defanor@uberspace.net>2017-12-15 17:50:38 +0300
commitbe0fce32fc99b26a3ae4e208fb2a244f441f3212 (patch)
tree1687c19c627610ef096efb40c27f5746b64bf9bc /Pancake.hs
parenta6c75aeb7ab8a7a9879aa5b1e17ffec4c18d446a (diff)
Add the "redisplay" command
Diffstat (limited to 'Pancake.hs')
-rw-r--r--Pancake.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Pancake.hs b/Pancake.hs
index 5d49b1a..e854d13 100644
--- a/Pancake.hs
+++ b/Pancake.hs
@@ -317,6 +317,12 @@ command Quit = liftIO $ do
command Interrupt =
putErrLn "Received SIGINT. Interrupt twice in a row to quit."
command (SetWidth w) = modify $ \s -> s { columns = w }
+command Redisplay = do
+ st <- get
+ case history st of
+ ((uri, doc):_, _) -> printDoc uri doc
+ _ -> putErrLn "There's nothing to redisplay"
+
-- | Reads commands, runs them.
eventLoop :: MonadIO m => StateT LoopState m ()