restrict edit_command (for sendback) to current node -- no attempt to goto target buffer first, which might not be loaded;
authorwenzelm
Tue, 05 Aug 2014 12:42:38 +0200
changeset 57861 287e3b1298b3
parent 57860 bcc243ea48e7
child 57862 8f074e6e22fc
restrict edit_command (for sendback) to current node -- no attempt to goto target buffer first, which might not be loaded;
src/Tools/jEdit/src/isabelle.scala
--- 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 _ =>
       }
     }
   }