aboutsummaryrefslogtreecommitdiff
path: root/src/Internal/Lib.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-04-04 17:21:16 -0600
committerJosh Rahm <joshuarahm@gmail.com>2022-10-09 12:19:46 -0600
commit67685752a1b3f9c29556b5c033c29e9736378f0b (patch)
tree171a3acb7430699fe5867f2b3f525787102e6da8 /src/Internal/Lib.hs
parentfcb81c33239a63d88b8ae0005008296135a1721c (diff)
downloadrde-67685752a1b3f9c29556b5c033c29e9736378f0b.tar.gz
rde-67685752a1b3f9c29556b5c033c29e9736378f0b.tar.bz2
rde-67685752a1b3f9c29556b5c033c29e9736378f0b.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.hs9
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