XMonad.Util.Paste: +alistra's patch for fixing his pasting of things like email address (@)

This commit is contained in:
gwern0
2011-11-28 21:56:48 +00:00
parent 9e69773d98
commit 9b369949ff

View File

@@ -54,9 +54,9 @@ pasteSelection :: X ()
pasteSelection = getSelection >>= pasteString
-- | Send a string to the window which is currently focused. This function correctly
-- handles capitalization.
-- handles capitalization. Warning: in dealing with capitalized characters, this assumes a QWERTY layout.
pasteString :: String -> X ()
pasteString = mapM_ (\x -> if isUpper x then pasteChar shiftMask x else pasteChar noModMask x)
pasteString = mapM_ (\x -> if isUpper x || || x `elem` "!@#$%^&*()_+{}:<>?\"" then pasteChar shiftMask x else pasteChar noModMask x)
{- | Send a character to the current window. This is more low-level.
Remember that you must handle the case of capitalization appropriately.