diff options
Diffstat (limited to 'XMonad/Config')
-rw-r--r-- | XMonad/Config/Droundy.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/XMonad/Config/Droundy.hs b/XMonad/Config/Droundy.hs index 27e1987..126a2ef 100644 --- a/XMonad/Config/Droundy.hs +++ b/XMonad/Config/Droundy.hs @@ -133,8 +133,12 @@ config = defaultConfig mytab = tabbed CustomShrink defaultTConf instance Shrinker CustomShrink where + shrinkIt shr s | Just s' <- dropFromHead " " s = shrinkIt shr s' shrinkIt shr s | Just s' <- dropFromTail " " s = shrinkIt shr s' shrinkIt shr s | Just s' <- dropFromTail "- Iceweasel" s = shrinkIt shr s' + shrinkIt shr s | Just s' <- dropFromTail "- KPDF" s = shrinkIt shr s' + shrinkIt shr s | Just s' <- dropFromHead "file://" s = shrinkIt shr s' + shrinkIt shr s | Just s' <- dropFromHead "http://" s = shrinkIt shr s' shrinkIt _ s | n > 9 = s : map cut [2..(halfn-3)] ++ shrinkIt shrinkText s where n = length s halfn = n `div` 2 @@ -145,3 +149,7 @@ instance Shrinker CustomShrink where dropFromTail :: String -> String -> Maybe String dropFromTail t s | drop (length s - length t) s == t = Just $ take (length s - length t) s | otherwise = Nothing + +dropFromHead :: String -> String -> Maybe String +dropFromHead h s | take (length h) s == h = Just $ drop (length h) s + | otherwise = Nothing |