Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: Work around fansi escaping issues #731

Merged
merged 2 commits into from
Dec 18, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions mdoc/src/main/scala/mdoc/internal/io/ConsoleReporter.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package mdoc.internal.io

import coursierapi.Logger
import fansi.ErrorMode
import fansi.Str
import mdoc.Reporter
import mdoc.internal.pos.PositionSyntax._

import java.io.PrintStream
import java.util.concurrent.atomic.AtomicBoolean
import scala.meta.Position
import mdoc.Reporter
import mdoc.internal.pos.PositionSyntax._
import coursierapi.Logger

class ConsoleReporter(
ps: PrintStream,
Expand Down Expand Up @@ -49,24 +52,24 @@ class ConsoleReporter(
}
def error(msg: String): Unit = {
myErrors += 1
ps.println(myError ++ s": $msg")
ps.println(myError ++ Str(s": $msg", ErrorMode.Strip))
}
def warning(pos: Position, msg: String): Unit = {
warning(formatMessage(pos.toUnslicedPosition, "warning", msg))
}
def warning(msg: String): Unit = {
myWarnings += 1
ps.println(myWarning ++ s": $msg")
ps.println(myWarning ++ Str(s": $msg", ErrorMode.Strip))
}
def info(pos: Position, msg: String): Unit = {
info(formatMessage(pos.toUnslicedPosition, "info", msg))
}
def info(msg: String): Unit = {
ps.println(myInfo ++ s": $msg")
ps.println(myInfo ++ Str(s": $msg", ErrorMode.Strip))
}
def debug(msg: => String): Unit = {
if (isDebugEnabled.get()) {
ps.println(myDebug ++ s": $msg")
ps.println(myDebug ++ Str(s": $msg", ErrorMode.Strip))
}
}

Expand Down