diff options
| author | Josh Rahm <rahm@google.com> | 2022-04-04 17:21:16 -0600 |
|---|---|---|
| committer | Josh Rahm <rahm@google.com> | 2022-04-04 17:21:16 -0600 |
| commit | 9b5a7b99d33891f0bc664316c643337ac638cbae (patch) | |
| tree | aa1501058bd5c786b97dc868c6fc1e44d3b447cb /src/Internal/Lib.hs | |
| parent | c194a9be4e43bc4514070d172024fcf3354fb662 (diff) | |
| download | rde-9b5a7b99d33891f0bc664316c643337ac638cbae.tar.gz rde-9b5a7b99d33891f0bc664316c643337ac638cbae.tar.bz2 rde-9b5a7b99d33891f0bc664316c643337ac638cbae.zip | |
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.
Diffstat (limited to 'src/Internal/Lib.hs')
| -rw-r--r-- | src/Internal/Lib.hs | 9 |
1 files changed, 3 insertions, 6 deletions
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 |