diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2022-11-22 00:20:28 -0700 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2022-11-22 00:20:28 -0700 |
| commit | 43a880fbbcbd76ad103cf0633bd7bb8a74077556 (patch) | |
| tree | 2ff333f0e55901dc24542683e8499f6637e8b6a5 /src/Rahm/Desktop/Keys | |
| parent | b6afd40aad39f2a05fbefae0fe2b080190623023 (diff) | |
| download | rde-43a880fbbcbd76ad103cf0633bd7bb8a74077556.tar.gz rde-43a880fbbcbd76ad103cf0633bd7bb8a74077556.tar.bz2 rde-43a880fbbcbd76ad103cf0633bd7bb8a74077556.zip | |
Better implementation of the pending buffer. Still need to iron out some bugs.
Diffstat (limited to 'src/Rahm/Desktop/Keys')
| -rw-r--r-- | src/Rahm/Desktop/Keys/Wml.hs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/Rahm/Desktop/Keys/Wml.hs b/src/Rahm/Desktop/Keys/Wml.hs index 10f2b5f..623e59a 100644 --- a/src/Rahm/Desktop/Keys/Wml.hs +++ b/src/Rahm/Desktop/Keys/Wml.hs @@ -14,7 +14,7 @@ -- \%@s // All windows except those on workspace 's' module Rahm.Desktop.Keys.Wml where -import Control.Monad (forM_, join, unless) +import Control.Monad (forM_, join, unless, when) import Control.Monad.Trans.Class import Control.Monad.Trans.Maybe import Control.Monad.Trans.State as S @@ -67,7 +67,11 @@ data Workspace = forall a. readWorkspaceMacro :: MaybeT X () readWorkspaceMacro = - mapNextStringWithKeysym $ \mask sym _ -> do + mapNextStringWithKeysym $ \mask sym s -> do + when (sym == xK_Escape) $ + fail "" + + lift $ setPendingBuffer $ printf "Rec %s " s macro <- readMacroString lift $ XS.modify $ \m -> @@ -77,7 +81,11 @@ readWorkspaceMacro = readWindowsetMacro :: MaybeT X () readWindowsetMacro = - mapNextStringWithKeysym $ \mask sym _ -> do + mapNextStringWithKeysym $ \mask sym s -> do + when (sym == xK_Escape) $ + fail "" + + lift $ setPendingBuffer $ printf "Rec %s " s macro <- readMacroString lift $ XS.modify $ \m -> @@ -90,7 +98,9 @@ readMacroString = do mapNextStringWithKeysym $ \m k s -> case (m, k, s) of _ | k == xK_Return -> return [] _ | k == xK_Escape -> MaybeT $ return Nothing - r -> ([r] ++) <$> readMacroString + r -> do + lift $ addStringToPendingBuffer s + ([r] ++) <$> readMacroString justWorkspace :: String -> Workspace justWorkspace s = |