default command position is only valid for default text chunk (amending dcb758188aa6);
authorwenzelm
Wed, 20 Aug 2014 15:12:32 +0200
changeset 58015 2777096e0adf
parent 58014 47ecbef7274b
child 58016 28e5ccf4a27f
default command position is only valid for default text chunk (amending dcb758188aa6);
src/Pure/PIDE/protocol.scala
--- a/src/Pure/PIDE/protocol.scala	Wed Aug 20 11:54:17 2014 +0200
+++ b/src/Pure/PIDE/protocol.scala	Wed Aug 20 15:12:32 2014 +0200
@@ -320,7 +320,13 @@
     def elem_positions(props: Properties.T, set: Set[Text.Range]): Set[Text.Range] =
       props match {
         case Position.Identified(id, name) if self_id(id) && name == chunk_name =>
-          Position.Range.unapply(props) orElse Position.Range.unapply(command_position) match {
+          val opt_range =
+            Position.Range.unapply(props) orElse {
+              if (name == Symbol.Text_Chunk.Default)
+                Position.Range.unapply(command_position)
+              else None
+            }
+          opt_range match {
             case Some(symbol_range) =>
               chunk.incorporate(symbol_range) match {
                 case Some(range) => set + range