From 5f49f4589c254d5c9466a73286ae4d930fc83859 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 18 Dec 2017 11:29:34 -0500 Subject: [PATCH] Replacements advance past the maximal id in the before state. --- src/Rendering/DOT.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Rendering/DOT.hs b/src/Rendering/DOT.hs index 044ac0a05..29df8fc5a 100644 --- a/src/Rendering/DOT.hs +++ b/src/Rendering/DOT.hs @@ -30,8 +30,8 @@ diffAlgebra d i = case d of Merge t -> termAlgebra t i Patch (Delete t1) -> termAlgebra t1 i `modifyHeadNode` setColour "red" Patch (Insert t2) -> termAlgebra t2 i `modifyHeadNode` setColour "green" - Patch (Replace t1 t2) -> let r1 = termAlgebra t1 i `modifyHeadNode` setColour "red" - in r1 <> termAlgebra t2 (succ (maximum (i : fst r1))) `modifyHeadNode` setColour "green" + Patch (Replace t1 t2) -> let r1 = termAlgebra t1 i `modifyHeadNode` setColour "red" + in r1 <> termAlgebra t2 (succ (maximum (i : map nodeID (graphNodes (snd r1))))) `modifyHeadNode` setColour "green" where modifyHeadNode (i, g) f | n:ns <- graphNodes g = (i, g { graphNodes = f n : ns }) | otherwise = (i, g) setColour c n = n { nodeAttributes = Map.insert "color" c (nodeAttributes n) }