From 488a05bc28b23fb35b4f06cc006c7a3b9a85debb Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 15 Apr 2016 14:32:24 -0400 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20compute=20term=20sizes,=20use?= =?UTF-8?q?=20the=20cached=20ones.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UI/nested-insert.html | 28 ++++++++++++++++++++++++++++ src/Renderer/Split.hs | 4 ++-- 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 UI/nested-insert.html diff --git a/UI/nested-insert.html b/UI/nested-insert.html new file mode 100644 index 000000000..36e786f1f --- /dev/null +++ b/UI/nested-insert.html @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + +
1
    • if (
    • true
    • )
      • { +
1
    • if (
    • true
    • )
      • { +
2
            • console
            • .
            • log
          • (
              • '
              • hello
              • '
          • )
        • ;
      • +
2
            • console
            • .
            • log
          • (
              • '
              • hello
              • '
          • )
        • ;
      • +
3
    • }
  • +
3
            • console
            • .
            • log
          • (
              • '
              • world
              • '
          • )
        • ;
      • +
4
      • }
  • +
5
    • }
  • +
6
    \ No newline at end of file diff --git a/src/Renderer/Split.hs b/src/Renderer/Split.hs index f47e2606b..8f42ee39e 100644 --- a/src/Renderer/Split.hs +++ b/src/Renderer/Split.hs @@ -118,8 +118,8 @@ instance ToMarkup (Renderable (Source Char, Term a Info)) where instance ToMarkup (Renderable (Source Char, SplitDiff a Info)) where toMarkup (Renderable (source, diff)) = Prelude.fst $ iter (\ (Annotated 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 _ _ :< _) = getSplitTerm patch in - ((div ! A.class_ (splitPatchToClassName patch) ! A.data_ (stringValue . show $ termSize term)) . toMarkup $ Renderable (source, term), range) + toMarkupAndRange patch = let term@(Info range _ size :< _) = getSplitTerm patch in + ((div ! A.class_ (splitPatchToClassName patch) ! A.data_ (stringValue (show size))) . toMarkup $ Renderable (source, term), range) instance ToMarkup a => ToMarkup (Renderable (Bool, Int, a)) where