src/Tools/jEdit/src/rendering.scala
changeset 52650 4cf6fbf1d9a1
parent 52644 cea207576f81
child 52873 9e934d4fff00
     1.1 --- a/src/Tools/jEdit/src/rendering.scala	Sat Jul 13 17:05:22 2013 +0200
     1.2 +++ b/src/Tools/jEdit/src/rendering.scala	Sat Jul 13 18:13:09 2013 +0200
     1.3 @@ -124,16 +124,17 @@
     1.4    val bullet_color = color_value("bullet_color")
     1.5    val tooltip_color = color_value("tooltip_color")
     1.6    val writeln_color = color_value("writeln_color")
     1.7 +  val information_color = color_value("information_color")
     1.8    val warning_color = color_value("warning_color")
     1.9    val error_color = color_value("error_color")
    1.10    val error1_color = color_value("error1_color")
    1.11    val writeln_message_color = color_value("writeln_message_color")
    1.12 +  val information_message_color = color_value("information_message_color")
    1.13    val tracing_message_color = color_value("tracing_message_color")
    1.14    val warning_message_color = color_value("warning_message_color")
    1.15    val error_message_color = color_value("error_message_color")
    1.16    val bad_color = color_value("bad_color")
    1.17    val intensify_color = color_value("intensify_color")
    1.18 -  val information_color = color_value("information_color")
    1.19    val quoted_color = color_value("quoted_color")
    1.20    val antiquoted_color = color_value("antiquoted_color")
    1.21    val highlight_color = color_value("highlight_color")
    1.22 @@ -416,6 +417,7 @@
    1.23  
    1.24    private val squiggly_colors = Map(
    1.25      Rendering.writeln_pri -> writeln_color,
    1.26 +    Rendering.information_pri -> information_color,
    1.27      Rendering.warning_pri -> warning_color,
    1.28      Rendering.error_pri -> error_color)
    1.29  
    1.30 @@ -426,10 +428,12 @@
    1.31      val results =
    1.32        snapshot.cumulate_markup[Int](range, 0, Some(squiggly_elements), _ =>
    1.33          {
    1.34 -          case (pri, Text.Info(_, XML.Elem(Markup(name, _), _)))
    1.35 +          case (pri, Text.Info(_, msg @ XML.Elem(Markup(name, _), _)))
    1.36            if name == Markup.WRITELN ||
    1.37              name == Markup.WARNING ||
    1.38 -            name == Markup.ERROR => pri max Rendering.message_pri(name)
    1.39 +            name == Markup.ERROR =>
    1.40 +              if (Protocol.is_information(msg)) pri max Rendering.information_pri
    1.41 +              else pri max Rendering.message_pri(name)
    1.42          })
    1.43      for {
    1.44        Text.Info(r, pri) <- results
    1.45 @@ -438,20 +442,24 @@
    1.46    }
    1.47  
    1.48  
    1.49 -  private val messages_include =
    1.50 -    Set(Markup.WRITELN_MESSAGE, Markup.TRACING_MESSAGE, Markup.WARNING_MESSAGE, Markup.ERROR_MESSAGE)
    1.51 -
    1.52    private val message_colors = Map(
    1.53      Rendering.writeln_pri -> writeln_message_color,
    1.54 +    Rendering.information_pri -> information_message_color,
    1.55      Rendering.tracing_pri -> tracing_message_color,
    1.56      Rendering.warning_pri -> warning_message_color,
    1.57      Rendering.error_pri -> error_message_color)
    1.58  
    1.59 +  private val line_background_elements =
    1.60 +    Set(Markup.WRITELN_MESSAGE, Markup.TRACING_MESSAGE, Markup.WARNING_MESSAGE,
    1.61 +      Markup.ERROR_MESSAGE, Markup.INFORMATION)
    1.62 +
    1.63    def line_background(range: Text.Range): Option[(Color, Boolean)] =
    1.64    {
    1.65      val results =
    1.66 -      snapshot.cumulate_markup[Int](range, 0, Some(messages_include), _ =>
    1.67 +      snapshot.cumulate_markup[Int](range, 0, Some(line_background_elements), _ =>
    1.68          {
    1.69 +          case (pri, Text.Info(_, XML.Elem(Markup(Markup.INFORMATION, _), _))) =>
    1.70 +            pri max Rendering.information_pri
    1.71            case (pri, Text.Info(_, XML.Elem(Markup(name, _), _)))
    1.72            if name == Markup.WRITELN_MESSAGE ||
    1.73              name == Markup.TRACING_MESSAGE ||
    1.74 @@ -478,8 +486,8 @@
    1.75  
    1.76    private val background1_include =
    1.77      Protocol.command_status_markup + Markup.WRITELN_MESSAGE + Markup.TRACING_MESSAGE +
    1.78 -      Markup.WARNING_MESSAGE + Markup.ERROR_MESSAGE + Markup.BAD + Markup.INTENSIFY +
    1.79 -      Markup.INFORMATION ++ active_include
    1.80 +      Markup.WARNING_MESSAGE + Markup.ERROR_MESSAGE + Markup.BAD + Markup.INTENSIFY ++
    1.81 +      active_include
    1.82  
    1.83    def background1(range: Text.Range): Stream[Text.Info[Color]] =
    1.84    {
    1.85 @@ -497,8 +505,6 @@
    1.86                  (None, Some(bad_color))
    1.87                case (_, Text.Info(_, XML.Elem(Markup(Markup.INTENSIFY, _), _))) =>
    1.88                  (None, Some(intensify_color))
    1.89 -              case (_, Text.Info(_, XML.Elem(Markup(Markup.INFORMATION, _), _))) =>
    1.90 -                (None, Some(information_color))
    1.91                case (acc, Text.Info(_, Protocol.Dialog(_, serial, result))) =>
    1.92                  command_state.results.get(serial) match {
    1.93                    case Some(Protocol.Dialog_Result(res)) if res == result =>