Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (22 sloc) 0.617 kb
package sbt
import java.util.regex.Pattern
import scala.Console.{BOLD, RESET}
object Highlight
{
final val NormalIntensity = "\033[22m"
final val NormalTextColor = "\033[39m"
def showMatches(pattern: Pattern)(line: String): Option[String] =
{
val matcher = pattern.matcher(line)
if(ConsoleLogger.formatEnabled)
{
val highlighted = matcher.replaceAll(scala.Console.RED + "$0" + NormalTextColor)
if(highlighted == line) None else Some(highlighted)
}
else if(matcher.find)
Some(line)
else
None
}
def bold(s: String) = if(ConsoleLogger.formatEnabled) BOLD + s + NormalIntensity else s
}
Jump to Line
Something went wrong with that request. Please try again.