1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 08:54:07 +03:00

Revert "Render sizes minimally in split diffs."

This reverts commit af17b7c6b85462a902ab296c0c0334aa26b4e0b9.
This commit is contained in:
Rob Rix 2016-05-30 14:04:40 -04:00
parent a3ba420fb4
commit 6c435a39b4

View File

@ -92,7 +92,7 @@ split diff blobs = TL.toStrict . renderHtml
newtype Renderable a = Renderable a
instance ToMarkup f => ToMarkup (Renderable (Source Char, Info, Syntax a (f, Range))) where
toMarkup (Renderable (source, Info range categories size, syntax)) = (! A.data_ (stringValue (showRational size))) . classifyMarkup categories $ case syntax of
toMarkup (Renderable (source, Info range categories size, syntax)) = (! A.data_ (stringValue (show size))) . classifyMarkup categories $ case syntax of
Leaf _ -> span . string . toString $ slice range source
Indexed children -> ul . mconcat $ wrapIn li <$> contentElements source range children
Fixed children -> ul . mconcat $ wrapIn li <$> contentElements source range children
@ -119,7 +119,7 @@ instance ToMarkup (Renderable (Source Char, SplitDiff a Info)) where
toMarkup (Renderable (source, diff)) = Prologue.fst $ iter (\ (info@(Info range _ _) :< syntax) -> (toMarkup $ Renderable (source, info, syntax), range)) $ toMarkupAndRange <$> diff
where toMarkupAndRange :: SplitPatch (Term a Info) -> (Markup, Range)
toMarkupAndRange patch = let term@(Info range _ size :< _) = runCofree $ getSplitTerm patch in
((div ! A.class_ (splitPatchToClassName patch) ! A.data_ (stringValue (showRational size))) . toMarkup $ Renderable (source, cofree term), range)
((div ! A.class_ (splitPatchToClassName patch) ! A.data_ (stringValue (show size))) . toMarkup $ Renderable (source, cofree term), range)
instance ToMarkup a => ToMarkup (Renderable (Bool, Int, a)) where
toMarkup (Renderable (hasChanges, num, line)) =