From 67685752a1b3f9c29556b5c033c29e9736378f0b Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Mon, 4 Apr 2022 17:21:16 -0600 Subject: Implement a window history system. This lets the user cycle between past windows. The rules for when a window gets added to the history is the same as when a window is considered the last marked. In fact, now all the last mark does is swap the current window with the previous one in the history. --- src/Internal/Lib.hs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/Internal/Lib.hs') diff --git a/src/Internal/Lib.hs b/src/Internal/Lib.hs index e608bb0..c29ca31 100644 --- a/src/Internal/Lib.hs +++ b/src/Internal/Lib.hs @@ -77,8 +77,7 @@ gotoAccompaningWorkspace = do else gotoWorkspace (toUpper cur) gotoWorkspace :: WorkspaceName -> X () -gotoWorkspace ch = do - saveLastMark +gotoWorkspace ch = pushHistory $ do addHiddenWorkspace [ch] windows $ greedyView $ return ch @@ -149,7 +148,7 @@ withScreen fn n = do Just screen -> fn (tag $ workspace screen) windowSet windowJump :: X () -windowJump = do +windowJump = pushHistory $ do windowTitlesToWinId <- withWindowSet $ \ss -> Map.fromList <$> mapM (\wid -> (,) <$> getString wid <*> return wid) (allWindows ss) @@ -157,6 +156,4 @@ windowJump = do case windowId of Nothing -> return () - Just wid -> do - saveLastMark - focus wid + Just wid -> focus wid -- cgit