full merge of Command.State, which enables Command.prints to augment markup as well (assuming that these dynamic overlays are relatively few);
authorwenzelm
Sat, 13 Jul 2013 12:39:45 +0200
changeset 52642 84eb792224a8
parent 52641 c56b6fa636e8
child 52643 34c29356930e
full merge of Command.State, which enables Command.prints to augment markup as well (assuming that these dynamic overlays are relatively few);
src/Pure/PIDE/command.scala
src/Pure/PIDE/markup_tree.scala
--- a/src/Pure/PIDE/command.scala	Sat Jul 13 00:50:49 2013 +0200
+++ b/src/Pure/PIDE/command.scala	Sat Jul 13 12:39:45 2013 +0200
@@ -130,7 +130,10 @@
       }
 
     def ++ (other: State): State =
-      copy(results = results ++ other.results)  // FIXME merge more content!?
+      copy(
+        status = other.status ::: status,
+        results = results ++ other.results,
+        markup = markup ++ other.markup)
   }
 
 
--- a/src/Pure/PIDE/markup_tree.scala	Sat Jul 13 00:50:49 2013 +0200
+++ b/src/Pure/PIDE/markup_tree.scala	Sat Jul 13 12:39:45 2013 +0200
@@ -184,6 +184,10 @@
     }
   }
 
+  def ++ (other: Markup_Tree): Markup_Tree =
+    (this /: other.branches)({ case (tree, (range, entry)) =>
+      ((tree ++ entry.subtree) /: entry.markup)({ case (t, elem) => t + Text.Info(range, elem) }) })
+
   def to_XML(root_range: Text.Range, text: CharSequence, filter: XML.Elem => Boolean): XML.Body =
   {
     def make_text(start: Text.Offset, stop: Text.Offset): XML.Body =