From be0fce32fc99b26a3ae4e208fb2a244f441f3212 Mon Sep 17 00:00:00 2001 From: defanor Date: Fri, 15 Dec 2017 17:17:57 +0300 Subject: Add the "redisplay" command --- Pancake.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Pancake.hs') 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 () -- cgit v1.2.3