src/Tools/jEdit/src/isabelle.scala
changeset 57861 287e3b1298b3
parent 57627 65fc7ae1bf66
child 58529 cd4439d8799c
--- a/src/Tools/jEdit/src/isabelle.scala	Tue Aug 05 12:14:25 2014 +0200
+++ b/src/Tools/jEdit/src/isabelle.scala	Tue Aug 05 12:42:38 2014 +0200
@@ -232,8 +232,8 @@
     s: String)
   {
     if (!snapshot.is_outdated) {
-      snapshot.state.find_command(snapshot.version, id) match {
-        case Some((node, command)) =>
+      (snapshot.state.find_command(snapshot.version, id), PIDE.document_model(buffer)) match {
+        case (Some((node, command)), Some(model)) if command.node_name == model.node_name =>
           node.command_start(command) match {
             case Some(start) =>
               JEdit_Lib.buffer_edit(buffer) {
@@ -248,7 +248,7 @@
               }
             case None =>
           }
-        case None =>
+        case _ =>
       }
     }
   }