aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-08-03 15:49:24 -0600
committerJosh Rahm <rahm@google.com>2022-08-03 15:49:24 -0600
commit6122cd030e03945382dad927c32a259c077bd468 (patch)
tree2eaef461c926d1e3703f68be30d1caccd2bd2711 /src/Rahm
parentc9159878868bea1fcc7d40d85f09cb29428ba0d5 (diff)
downloadrde-6122cd030e03945382dad927c32a259c077bd468.tar.gz
rde-6122cd030e03945382dad927c32a259c077bd468.tar.bz2
rde-6122cd030e03945382dad927c32a259c077bd468.zip
Add check for xK_Escape to end trynig ot type a Wml object.
Diffstat (limited to 'src/Rahm')
-rw-r--r--src/Rahm/Desktop/Keys/Wml.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Rahm/Desktop/Keys/Wml.hs b/src/Rahm/Desktop/Keys/Wml.hs
index 9074b66..34dabd2 100644
--- a/src/Rahm/Desktop/Keys/Wml.hs
+++ b/src/Rahm/Desktop/Keys/Wml.hs
@@ -214,6 +214,8 @@ readNextWorkspace :: (KeyFeeder m) => MaybeT m Workspace
readNextWorkspace =
readNextKey $ \mask sym str ->
case (mask, sym, str) of
+ (_, e, _) | e == xK_Escape -> MaybeT $ return Nothing
+
(_, _, [ch]) | isAlphaNum ch || ch == '*' -> return $ justWorkspace [ch]
(_, _, "[") ->
justWorkspace <$>
@@ -291,14 +293,14 @@ readNextWorkspace =
then ws3
else ws4
- -- ?&s@.'@s
-
(_, _, "?") -> do
l1 <- readNextLocationSet
ws1 <- readNextWorkspace
ws2 <- readNextWorkspace
+ mt $ logs Trace "If not empty %s then %s else %s" (show l1) (show $ workspaceName ws1) (show $ workspaceName ws2)
+
return $
if null l1
then ws2
@@ -315,6 +317,8 @@ readNextLocationSet :: (KeyFeeder m) => MaybeT m [Location]
readNextLocationSet =
readNextKey $ \mask sym str ->
case (mask, sym, str) of
+ (_, e, _) | e == xK_Escape -> MaybeT $ return Nothing
+
(_, _, [ch]) | isAlpha ch -> mt $ getMarkedLocations [ch]
(_, _, "0") -> (:[]) <$> MaybeT (fromX getMostRecentLocationInHistory)
(_, _, [ch]) | isDigit ch ->