From a2e6b7617f67f16f9ede07a65d61ceb37adc4990 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Fri, 1 Apr 2022 00:26:28 -0600 Subject: Allow marks to be any alpha-numeric character, including unicode characters --- src/Internal/Keys.hs | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/Internal/Keys.hs b/src/Internal/Keys.hs index 1d3baf4..d340062 100644 --- a/src/Internal/Keys.hs +++ b/src/Internal/Keys.hs @@ -133,22 +133,19 @@ keymap = runKeys $ do bind xK_apostrophe $ do justMod $ doc "Jumps between marks." $ - subkeys $ do - bind xK_apostrophe $ - (noMod -|- justMod) $ - doc "Jumps to the last window." - jumpToLast - mapAlpha 0 jumpToMark + mapNextString $ \_ str -> + case str of + ['\''] -> jumpToLast + [ch] | isAlphaNum ch -> jumpToMark ch + _ -> return () shiftMod $ doc "Swap the current window with a mark." $ - subkeys $ do - bind xK_apostrophe $ - (noMod -|- shiftMod -|- rawMask shiftMask) $ - doc "Swap the current window with the last mark." - swapWithLastMark - - mapAlpha shiftMask swapWithMark + mapNextString $ \_ str -> + case str of + ['\''] -> swapWithLastMark + [ch] | isAlphaNum ch -> swapWithMark ch + _ -> return () bind xK_BackSpace $ do -- The only raw keybinding. Meant to get a terminal to unbrick XMonad if @@ -356,8 +353,10 @@ keymap = runKeys $ do bind xK_m $ do justMod $ doc "Mark the current window with the next typed character." $ - subkeys $ - mapAlpha 0 markCurrentWindow + mapNextString $ \_ str -> + case str of + [ch] | isAlphaNum ch -> markCurrentWindow ch + _ -> return () bind xK_n $ do justMod $ -- cgit