tuned;
authorwenzelm
Sun, 23 Feb 2014 15:38:21 +0100
changeset 55689 13b58baf994b
parent 55688 767edb2c1e4e
child 55690 d73949233c2e
tuned;
src/Tools/jEdit/src/rendering.scala
--- a/src/Tools/jEdit/src/rendering.scala	Sun Feb 23 15:35:19 2014 +0100
+++ b/src/Tools/jEdit/src/rendering.scala	Sun Feb 23 15:38:21 2014 +0100
@@ -348,12 +348,10 @@
   /* highlighted area */
 
   def highlight(range: Text.Range): Option[Text.Info[Color]] =
-  {
     snapshot.select(range, Rendering.highlight_elements, _ =>
       {
         case info => Some(Text.Info(snapshot.convert(info.range), highlight_color))
-      }) match { case Text.Info(_, info) :: _ => Some(info) case _ => None }
-  }
+      }).headOption.map(_.info)
 
 
   /* hyperlinks */
@@ -430,8 +428,7 @@
             }
           }
           else Some(Text.Info(snapshot.convert(info_range), elem))
-      }) match { case Text.Info(_, info) :: _ => Some(info) case _ => None }
-
+      }).headOption.map(_.info)
 
   def command_results(range: Text.Range): Command.Results =
   {