diff options
author | jao <jao@gnu.org> | 2022-10-06 06:46:13 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-10-06 06:46:13 +0100 |
commit | e5d00b351fc53a239f275ccd15023cd94ad38142 (patch) | |
tree | 576c2f1b937c8b4b4e96d55a110c8951247f530f | |
parent | 19e9105cd9e12a0b6f3401ae0d506f6d9317da0e (diff) | |
download | xmobar-e5d00b351fc53a239f275ccd15023cd94ad38142.tar.gz xmobar-e5d00b351fc53a239f275ccd15023cd94ad38142.tar.bz2 |
whitespace
-rw-r--r-- | src/Xmobar/Config/Template.hs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Xmobar/Config/Template.hs b/src/Xmobar/Config/Template.hs index 2a5b3d7..ad30c3d 100644 --- a/src/Xmobar/Config/Template.hs +++ b/src/Xmobar/Config/Template.hs @@ -39,11 +39,11 @@ retSegment (i, idx, as) widget = return [(widget, i, idx, as)] -- drawable segment specifications. parseString :: T.Config -> String -> [T.Segment] parseString c s = - case P.parse (stringParser ci) "" s of - Left _ -> [(T.Text $ "Could not parse string: " ++ s, ti, 0, Nothing)] - Right x -> concat x - where ci = (ti , 0, Nothing) - ti = T.TextRenderInfo (T.fgColor c) 0 0 [] + case P.parse (stringParser ci) "" s of + Left _ -> [(T.Text $ "Could not parse string: " ++ s, ti, 0, Nothing)] + Right x -> concat x + where ci = (ti , 0, Nothing) + ti = T.TextRenderInfo (T.fgColor c) 0 0 [] -- Top level parser reading the full template string stringParser :: Context -> Parser [[T.Segment]] @@ -104,8 +104,8 @@ hspaceParser c = do actionParser :: Context -> Parser [T.Segment] actionParser (ti, fi, act) = do P.string "<action=" - command <- C.choice [C.between (P.char '`') (P.char '`') (C.many1 (P.noneOf "`")) - , C.many1 (P.noneOf ">")] + command <- C.between (P.char '`') (P.char '`') (C.many1 (P.noneOf "`")) + <|> C.many1 (P.noneOf ">") buttons <- (P.char '>' >> return "1") <|> (P.space >> P.spaces >> C.between (P.string "button=") (P.string ">") (C.many1 (P.oneOf "12345"))) let a = T.Spawn (toButtons buttons) command |