# HG changeset patch # User wenzelm # Date 1606664729 -3600 # Node ID 6205c5d4fadf5a6b38787e12f77d7396977cc6ec # Parent 1cc74982d03882e58f42938d838c3b4883e8b349 restrict report redirection to current node; diff -r 1cc74982d038 -r 6205c5d4fadf src/Pure/PIDE/command.scala --- a/src/Pure/PIDE/command.scala Sun Nov 29 16:21:27 2020 +0100 +++ b/src/Pure/PIDE/command.scala Sun Nov 29 16:45:29 2020 +0100 @@ -261,7 +261,8 @@ def accumulate( self_id: Document_ID.Generic => Boolean, - other_id: Document_ID.Generic => Option[(Symbol.Text_Chunk.Id, Symbol.Text_Chunk)], + other_id: (Document.Node.Name, Document_ID.Generic) => + Option[(Symbol.Text_Chunk.Id, Symbol.Text_Chunk)], message: XML.Elem, xml_cache: XML.Cache): State = message match { @@ -293,7 +294,8 @@ val target = if (self_id(id) && command.chunks.isDefinedAt(chunk_name)) Some((chunk_name, command.chunks(chunk_name))) - else if (chunk_name == Symbol.Text_Chunk.Default) other_id(id) + else if (chunk_name == Symbol.Text_Chunk.Default) + other_id(command.node_name, id) else None (target, atts) match { diff -r 1cc74982d038 -r 6205c5d4fadf src/Pure/PIDE/document.scala --- a/src/Pure/PIDE/document.scala Sun Nov 29 16:21:27 2020 +0100 +++ b/src/Pure/PIDE/document.scala Sun Nov 29 16:45:29 2020 +0100 @@ -752,9 +752,14 @@ id == st.command.id || (execs.get(id) match { case Some(st1) => st1.command.id == st.command.id case None => false }) - private def other_id(id: Document_ID.Generic) + private def other_id(node_name: Node.Name, id: Document_ID.Generic) : Option[(Symbol.Text_Chunk.Id, Symbol.Text_Chunk)] = - lookup_id(id).map(st => ((Symbol.Text_Chunk.Id(st.command.id), st.command.chunk))) + { + for { + st <- lookup_id(id) + if st.command.node_name == node_name + } yield (Symbol.Text_Chunk.Id(st.command.id), st.command.chunk) + } private def redirection(st: Command.State): Graph[Document_ID.Command, Unit] = (commands_redirection /: st.markups.redirection_iterator)({ case (graph, id) =>