more careful treatment of initial update, similar to output panel;
authorwenzelm
Tue, 20 Sep 2011 15:23:17 +0200
changeset 45011 436ea69d5d37
parent 45010 8a4db903039f
child 45012 060f76635bfe
child 45031 9583f2b56f85
more careful treatment of initial update, similar to output panel;
src/Tools/jEdit/src/session_dockable.scala
--- a/src/Tools/jEdit/src/session_dockable.scala	Tue Sep 20 15:07:30 2011 +0200
+++ b/src/Tools/jEdit/src/session_dockable.scala	Tue Sep 20 15:23:17 2011 +0200
@@ -139,15 +139,15 @@
   }
   status.renderer = new Node_Renderer
 
-  private def handle_changed(changed_nodes: Set[Document.Node.Name])
+  private def handle_update(restriction: Option[Set[Document.Node.Name]] = None)
   {
     Swing_Thread.now {
-      // FIXME correlation to changed_nodes!?
       val snapshot = Isabelle.session.snapshot()
+      val nodes = restriction getOrElse snapshot.version.nodes.keySet
 
       var nodes_status1 = nodes_status
       for {
-        name <- changed_nodes
+        name <- nodes
         node <- snapshot.version.nodes.get(name)
         val status = Isar_Document.node_status(snapshot.state, snapshot.version, node)
       } nodes_status1 += (name -> status)
@@ -179,7 +179,7 @@
         case phase: Session.Phase =>
           Swing_Thread.now { session_phase.text = " " + phase.toString + " " }
 
-        case changed: Session.Commands_Changed => handle_changed(changed.nodes)
+        case changed: Session.Commands_Changed => handle_update(Some(changed.nodes))
 
         case bad => System.err.println("Session_Dockable: ignoring bad message " + bad)
       }
@@ -197,4 +197,6 @@
     Isabelle.session.phase_changed -= main_actor
     Isabelle.session.commands_changed -= main_actor
   }
+
+  handle_update()
 }