aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Fehrle2018-11-27 14:44:30 -0800
committerJim Fehrle2018-12-10 16:10:09 -0800
commit43ecefe2805e2178fa3c113c4889b7720676c905 (patch)
treefea2998db39db5dab3459955c0d3531f79077bff
parentec7ff743b42e9549519d556d36cf770802a6912f (diff)
Fix #9091: don't show deleted compacted hypotheses twice in diff
-rw-r--r--printing/proof_diffs.ml8
1 files changed, 3 insertions, 5 deletions
diff --git a/printing/proof_diffs.ml b/printing/proof_diffs.ml
index 02acacfe8e..508e939df8 100644
--- a/printing/proof_diffs.ml
+++ b/printing/proof_diffs.ml
@@ -138,13 +138,11 @@ let diff_hyps o_line_idents o_map n_line_idents n_map =
let hyp_diffs = diff_str ~tokenize_string o_line n_line in
let (has_added, has_removed) = has_changes hyp_diffs in
if show_removed () && has_removed then begin
- let o_entry = StringMap.find (List.hd old_ids) o_map in
- o_entry.done_ <- true;
+ List.iter (fun x -> (StringMap.find x o_map).done_ <- true) old_ids;
rv := (add_diff_tags `Removed o_pp hyp_diffs) :: !rv;
end;
if n_line <> "" then begin
- let n_entry = StringMap.find (List.hd new_ids) n_map in
- n_entry.done_ <- true;
+ List.iter (fun x -> (StringMap.find x n_map).done_ <- true) new_ids;
rv := (add_diff_tags `Added n_pp hyp_diffs) :: !rv
end
in
@@ -157,7 +155,7 @@ let diff_hyps o_line_idents o_map n_line_idents n_map =
if dtype = `Removed then begin
let o_idents = (StringMap.find ident o_map).idents in
(* only show lines that have all idents removed here; other removed idents appear later *)
- if show_removed () &&
+ if show_removed () && not (is_done ident o_map) &&
List.for_all (fun x -> not (exists x n_map)) o_idents then
output (List.rev o_idents) []
end