aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-08-03 15:49:24 -0600
committerJosh Rahm <joshuarahm@gmail.com>2022-10-09 12:19:46 -0600
commit2375862e26e09aae01da73fe7bf056ae571061d8 (patch)
tree6695d0e7322163287e98ad1c39351fc1084d0dd8 /src/Rahm
parent0b56ef1973acb421c2230819bea811453addba2e (diff)
downloadrde-2375862e26e09aae01da73fe7bf056ae571061d8.tar.gz
rde-2375862e26e09aae01da73fe7bf056ae571061d8.tar.bz2
rde-2375862e26e09aae01da73fe7bf056ae571061d8.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 ->