Omitted leading newlines when formatting NESTED_BLOCK messages

This commit is contained in:
Vhati 2013-08-26 10:02:00 -04:00
parent e86c38a4ee
commit 2033c80d6a

View file

@ -68,6 +68,14 @@ public class Report {
public void format( ReportMessage message, Appendable buf ) throws IOException {
if ( message.type == ReportMessage.NESTED_BLOCK ) {
// Already formatted this once, indent it instead.
// Skip leading newlines
int start = 0;
while ( start < message.text.length() && message.text.charAt(start) == '\n' )
start++;
if ( start > 0 )
indent( message.text.subSequence( start, message.text.length() ), buf );
else
indent( message.text, buf );
return;
}