src/Tools/jEdit/src/rendering.scala
changeset 50501 6f41f1646617
parent 50500 c94bba7906d2
child 50502 51408dde956f
     1.1 --- a/src/Tools/jEdit/src/rendering.scala	Thu Dec 13 13:52:18 2012 +0100
     1.2 +++ b/src/Tools/jEdit/src/rendering.scala	Thu Dec 13 17:29:23 2012 +0100
     1.3 @@ -254,16 +254,20 @@
     1.4  
     1.5    def active(range: Text.Range): Option[Text.Info[XML.Elem]] =
     1.6      snapshot.select_markup(range, Some(active_include), command_state =>
     1.7 -        {  // FIXME inactive dialog
     1.8 -          case Text.Info(info_range, elem @ XML.Elem(markup, _))
     1.9 -          if active_include(markup.name) => Text.Info(snapshot.convert(info_range), elem)
    1.10 +        {
    1.11 +          case Text.Info(info_range, elem @ Protocol.Dialog(_, serial, _))
    1.12 +          if !command_state.results.isDefinedAt(serial) =>
    1.13 +            Text.Info(snapshot.convert(info_range), elem)
    1.14 +          case Text.Info(info_range, elem @ XML.Elem(Markup(name, _), _))
    1.15 +          if name == Markup.GRAPHVIEW || name == Markup.SENDBACK =>
    1.16 +            Text.Info(snapshot.convert(info_range), elem)
    1.17          }) match { case Text.Info(_, info) #:: _ => Some(info) case _ => None }
    1.18  
    1.19  
    1.20    def tooltip_message(range: Text.Range): XML.Body =
    1.21    {
    1.22      val msgs =
    1.23 -      snapshot.cumulate_markup[SortedMap[Long, XML.Tree]](range, SortedMap.empty,
    1.24 +      snapshot.cumulate_markup[Command.Results](range, Command.empty_results,
    1.25          Some(Set(Markup.WRITELN, Markup.WARNING, Markup.ERROR, Markup.BAD)), _ =>
    1.26          {
    1.27            case (msgs, Text.Info(_, XML.Elem(Markup(name, props @ Markup.Serial(serial)), body)))
    1.28 @@ -433,12 +437,17 @@
    1.29                  (None, Some(bad_color))
    1.30                case (_, Text.Info(_, XML.Elem(Markup(Markup.INTENSIFY, _), _))) =>
    1.31                  (None, Some(intensify_color))
    1.32 -              case (_, Text.Info(_, Protocol.Dialog(_, serial, result))) =>
    1.33 -                command_state.results.get(serial) match {
    1.34 -                  case Some(Protocol.Dialog_Result(_, res)) if res == result =>
    1.35 -                    (None, Some(active_result_color))
    1.36 -                  case _ =>
    1.37 -                    (None, Some(active_color))
    1.38 +              case (acc, Text.Info(_, elem @ XML.Elem(Markup(Markup.DIALOG, _), _))) =>
    1.39 +                // FIXME pattern match problem in scala-2.9.2 (!??)
    1.40 +                elem match {
    1.41 +                  case Protocol.Dialog(_, serial, result) =>
    1.42 +                    command_state.results.get(serial) match {
    1.43 +                      case Some(Protocol.Dialog_Result(res)) if res == result =>
    1.44 +                        (None, Some(active_result_color))
    1.45 +                      case _ =>
    1.46 +                        (None, Some(active_color))
    1.47 +                    }
    1.48 +                  case _ => acc
    1.49                  }
    1.50                case (_, Text.Info(_, XML.Elem(markup, _))) if active_include(markup.name) =>
    1.51                  (None, Some(active_color))