From 03b8076f03a738f81e3edf10c1f19f1ab5ecccf9 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 17 Jun 2016 13:56:45 -0400 Subject: [PATCH] Show the underlying Integer, not the Size. --- src/Renderer/Split.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Renderer/Split.hs b/src/Renderer/Split.hs index 564cb1bbd..e2abd4095 100644 --- a/src/Renderer/Split.hs +++ b/src/Renderer/Split.hs @@ -93,7 +93,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, syntax)) = (! A.data_ (stringValue (show (size info)))) . classifyMarkup (category info) $ case syntax of + toMarkup (Renderable (source, info, syntax)) = (! A.data_ (stringValue (show (unSize (size info))))) . classifyMarkup (category info) $ case syntax of Leaf _ -> span . string . toString $ slice (characterRange info) source Indexed children -> ul . mconcat $ wrapIn li <$> contentElements source (characterRange info) children Fixed children -> ul . mconcat $ wrapIn li <$> contentElements source (characterRange info) children @@ -120,7 +120,7 @@ instance ToMarkup (Renderable (Source Char, SplitDiff a Info)) where toMarkup (Renderable (source, diff)) = Prologue.fst $ iter (\ (info :< syntax) -> (toMarkup $ Renderable (source, info, syntax), characterRange info)) $ toMarkupAndRange <$> diff where toMarkupAndRange :: SplitPatch (Term a Info) -> (Markup, Range) toMarkupAndRange patch = let term@(info :< _) = runCofree $ getSplitTerm patch in - ((div ! A.class_ (splitPatchToClassName patch) ! A.data_ (stringValue (show (size info)))) . toMarkup $ Renderable (source, cofree term), characterRange info) + ((div ! A.class_ (splitPatchToClassName patch) ! A.data_ (stringValue (show (unSize (size info))))) . toMarkup $ Renderable (source, cofree term), characterRange info) instance ToMarkup a => ToMarkup (Renderable (Bool, Int, a)) where toMarkup (Renderable (hasChanges, num, line)) =