rust-lang/rust-enhanced

Off-by-one suggestion message line number when includes trailing newline

Opened this issue · 0 comments

When a build message includes a suggestion, and the suggestion includes the newline, the suggestion phantom is attached to the following line. Although this makes sense from the perspective that the end of the phantom really is on the next line, it looks weird.

Image

In the above, the suggestion to remove the line also includes the newline.

Ideally it would be nice to detect this special case of the last line of the phantom is empty, and move the phantom up by one line.