mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-01 12:41:52 -07:00
X.P.OrgMode: Prune extra whitespace
This implements whitespace pruning at the end of a sheduled item or deadline. If we have a message like This is a message +s today it is expected that we created a heading of just "This is a message", without the extra whitespace.
This commit is contained in:
@@ -324,8 +324,10 @@ pInput inp = fmap fst . listToMaybe . (`readP_to_S` inp) . lchoice $
|
|||||||
next <- munch1 (/= head ptn)
|
next <- munch1 (/= head ptn)
|
||||||
next' <- munch1 (/= ' ')
|
next' <- munch1 (/= ' ')
|
||||||
if next' == ptn
|
if next' == ptn
|
||||||
then pure $ consumed <> next
|
then -- If we're done, it's time to prune extra whitespace
|
||||||
else go $ consumed <> next <> next'
|
pure $ consumed <> dropWhileEnd (== ' ') next
|
||||||
|
else -- If not, keep it as it's part of something else
|
||||||
|
go $ consumed <> next <> next'
|
||||||
|
|
||||||
-- | Try to parse a 'Time'.
|
-- | Try to parse a 'Time'.
|
||||||
pTimeOfDay :: ReadP (Maybe TimeOfDay)
|
pTimeOfDay :: ReadP (Maybe TimeOfDay)
|
||||||
|
Reference in New Issue
Block a user