aboutsummaryrefslogtreecommitdiffstats
path: root/app/Render.hs
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-02-29 04:11:10 +0100
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-14 07:07:39 +0100
commitf92c593a3d2c4bdb023fdd834b6e8c874d063cc8 (patch)
treeb506bb61f4951207aa1aff04080fd3d7874927c3 /app/Render.hs
parent941f0d4ccb688d42c0438e05051ed78a410431b6 (diff)
feat: add `review` command
Prototype of the `review` command, cf. `anissue review -h`. Also adds the `status` command.
Diffstat (limited to 'app/Render.hs')
-rw-r--r--app/Render.hs16
1 files changed, 8 insertions, 8 deletions
diff --git a/app/Render.hs b/app/Render.hs
index 907ef15..56d78aa 100644
--- a/app/Render.hs
+++ b/app/Render.hs
@@ -24,8 +24,9 @@ module Render
renderAsMarkdown,
-- * Additional symbols
- plus,
+ hash,
minus,
+ plus,
)
where
@@ -81,15 +82,15 @@ instance Render a => Render (IO a) where
(Just a, Nothing) -> a
(Nothing, Just b) -> b
(Just a, Just b) ->
- if endsWithNL a || startsWithNL b
+ if endsWithWS a || startsWithWS b
then a <> b
else a <> space <> b
where
nonEmpty x' =
let x = render x'
in if not (null (show x)) then Just (render x) else Nothing
- startsWithNL = ("\n" `isPrefixOf`) . show . render
- endsWithNL = ("\n" `isSuffixOf`) . show . render
+ startsWithWS = ((||) <$> ("\n" `isPrefixOf`) <*> (" " `isPrefixOf`)) . show . render
+ endsWithWS = ((||) <$> ("\n" `isSuffixOf`) <*> (" " `isSuffixOf`)) . show . render
(===) :: (Render a, Render b) => a -> b -> Doc AnsiStyle
(===) a' b' =
@@ -244,8 +245,7 @@ instance Render D.Node where
pretty ("\")" :: T.Text)
]
-plus :: Doc ann
-plus = pretty ("+" :: T.Text)
-
-minus :: Doc ann
+hash, minus, plus :: Doc ann
+hash = pretty ("#" :: T.Text)
minus = pretty ("-" :: T.Text)
+plus = pretty ("+" :: T.Text)