Closed
Description
According to the documentation, the lineContents
method of a Position
should not include a newline, but this code:
def lineContents: String =
source.subSequence(index(line - 1), index(line)).toString
includes everything from the start of line - 1
to the start of line
thereby including the newline at the end of the line.
The effect of this bug is that messages that use Position.longString
end up with an undesirable blank line between the contents line and the up arrow line since longString
also puts a newline between the two:
LINE CONTENTS
^
Presumably the fix is to use index(line) - 1
in the above code instead of index(line)
so that the newline is omitted.