From 4bea420c85d44c0ee003a1fe7aba60850b4811b2 Mon Sep 17 00:00:00 2001 From: mbays Date: Tue, 25 Jan 2022 00:00:00 +0000 Subject: [PATCH] on going to history item, do default and drop from queues --- diohsc.hs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/diohsc.hs b/diohsc.hs index f98f9ec..03b7327 100644 --- a/diohsc.hs +++ b/diohsc.hs @@ -1064,8 +1064,17 @@ handleCommandLine when isJump $ modify $ \s -> s { clientJumpBack = curr } modify $ \s -> s { clientCurrent = Just i } + doDefault :: HistoryItem -> ClientM () + doDefault item = + maybe (printErr "Bad default action!") ($ item) $ actionOfCommand defaultAction + goHistory :: HistoryItem -> ClientM () - goHistory i = setCurr i >> showUri (historyUri i) + goHistory item = do + dropUriFromQueues uri + showUri uri + doDefault item + setCurr item + where uri = historyUri item goUri :: Bool -> Maybe HistoryOrigin -> URI -> ClientM () goUri forceRequest origin uri = do @@ -1074,7 +1083,7 @@ handleCommandLine case curr >>= flip pathItemByUri uri of Just i' | not (activeId || forceRequest) -> goHistory i' _ -> doRequestUri uri $ \item -> do - maybe (printErr "Bad default action!") ($ item) $ actionOfCommand defaultAction + doDefault item liftIO $ slurpItem item let updateParent i = -- Lazily recursively update the links in the doubly linked list -- 2.11.4.GIT