Commit 76b9f0b6 authored by Romain Reuillon's avatar Romain Reuillon

[Core] fix: error line

parent 91d8bc16
......@@ -122,7 +122,7 @@ object ScalaREPL {
case NoPosition ErrorMessage(msg, msg, None)
case _
val compiled = new String(pos.source.content).split("\n")
val firstLine = compiled.zipWithIndex.find { case (l, _) l.contains(firstLineTag) }.map(_._2 + 1).getOrElse(0)
val firstLine = compiled.zipWithIndex.find { case (l, _) l.contains(firstLineTag) }.map(_._2 + 3).getOrElse(0)
val offset = compiled.take(firstLine).map(_.length + 1).sum
def errorPos = ErrorPosition(pos.line - firstLine, pos.start - offset, pos.end - offset, pos.point - offset)
def decoratedMessage = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment