src/Tools/jEdit/src/rendering.scala
changeset 50499 f496b2b7bafb
parent 50498 6647ba2775c1
child 50500 c94bba7906d2
     1.1 --- a/src/Tools/jEdit/src/rendering.scala	Wed Dec 12 21:50:42 2012 +0100
     1.2 +++ b/src/Tools/jEdit/src/rendering.scala	Wed Dec 12 23:36:07 2012 +0100
     1.3 @@ -250,8 +250,7 @@
     1.4    }
     1.5  
     1.6  
     1.7 -  private val active_include =
     1.8 -    Set(Markup.SENDBACK, Markup.DIALOG, Markup.DIALOG_RESULT, Markup.GRAPHVIEW)
     1.9 +  private val active_include = Set(Markup.SENDBACK, Markup.DIALOG, Markup.GRAPHVIEW)
    1.10  
    1.11    def active(range: Text.Range): Option[Text.Info[XML.Elem]] =
    1.12      snapshot.select_markup(range, Some(active_include),
    1.13 @@ -409,8 +408,8 @@
    1.14  
    1.15    private val background1_include =
    1.16      Protocol.command_status_markup + Markup.WRITELN_MESSAGE + Markup.TRACING_MESSAGE +
    1.17 -      Markup.WARNING_MESSAGE + Markup.ERROR_MESSAGE + Markup.BAD + Markup.INTENSIFY ++
    1.18 -      active_include
    1.19 +      Markup.WARNING_MESSAGE + Markup.ERROR_MESSAGE + Markup.BAD + Markup.INTENSIFY +
    1.20 +      Markup.DIALOG_RESULT ++ active_include
    1.21  
    1.22    def background1(range: Text.Range): Stream[Text.Info[Color]] =
    1.23    {
    1.24 @@ -418,28 +417,35 @@
    1.25      else
    1.26        for {
    1.27          Text.Info(r, result) <-
    1.28 -          snapshot.cumulate_markup[(Option[Protocol.Status], Option[Color])](
    1.29 -            range, (Some(Protocol.Status.init), None), Some(background1_include),
    1.30 +          snapshot.cumulate_markup[(Map[String, String], Option[Protocol.Status], Option[Color])](
    1.31 +            range, (Map.empty, Some(Protocol.Status.init), None), Some(background1_include),
    1.32              {
    1.33 -              case (((Some(status), color), Text.Info(_, XML.Elem(markup, _))))
    1.34 +              case (((dialogs, Some(status), color), Text.Info(_, XML.Elem(markup, _))))
    1.35                if (Protocol.command_status_markup(markup.name)) =>
    1.36 -                (Some(Protocol.command_status(status, markup)), color)
    1.37 -              case (_, Text.Info(_, XML.Elem(Markup(Markup.BAD, _), _))) =>
    1.38 -                (None, Some(bad_color))
    1.39 -              case (_, Text.Info(_, XML.Elem(Markup(Markup.INTENSIFY, _), _))) =>
    1.40 -                (None, Some(intensify_color))
    1.41 -              case (_, Text.Info(_, XML.Elem(Markup(Markup.DIALOG_RESULT, _), _))) =>
    1.42 -                (None, Some(active_result_color))
    1.43 -              case (_, Text.Info(_, XML.Elem(Markup(name, _), _))) if active_include(name) =>
    1.44 -                (None, Some(active_color))
    1.45 +                (dialogs, Some(Protocol.command_status(status, markup)), color)
    1.46 +              case ((dialogs, _, _), Text.Info(_, XML.Elem(Markup(Markup.BAD, _), _))) =>
    1.47 +                (dialogs, None, Some(bad_color))
    1.48 +              case ((dialogs, _, _), Text.Info(_, XML.Elem(Markup(Markup.INTENSIFY, _), _))) =>
    1.49 +                (dialogs, None, Some(intensify_color))
    1.50 +              case ((dialogs, status, color), Text.Info(_,
    1.51 +                XML.Elem(Markup(Markup.DIALOG_RESULT, Markup.Dialog_Args(name, result)), _))) =>
    1.52 +                (dialogs + (name -> result), status, color)
    1.53 +              case ((dialogs, _, _), Text.Info(_,
    1.54 +                XML.Elem(Markup(Markup.DIALOG, Markup.Dialog_Args(name, result)), _))) =>
    1.55 +                  if (dialogs.get(name) == Some(result))
    1.56 +                    (dialogs, None, Some(active_result_color))
    1.57 +                  else (dialogs, None, Some(active_color))
    1.58 +              case ((dialogs, _, _), Text.Info(_, XML.Elem(Markup(name, _), _)))
    1.59 +              if active_include(name) =>
    1.60 +                (dialogs, None, Some(active_color))
    1.61              })
    1.62          color <-
    1.63            (result match {
    1.64 -            case (Some(status), opt_color) =>
    1.65 +            case (_, Some(status), opt_color) =>
    1.66                if (status.is_unprocessed) Some(unprocessed1_color)
    1.67                else if (status.is_running) Some(running1_color)
    1.68                else opt_color
    1.69 -            case (_, opt_color) => opt_color
    1.70 +            case (_, _, opt_color) => opt_color
    1.71            })
    1.72        } yield Text.Info(r, color)
    1.73    }