updated formatting when source snippets is too long

This commit is contained in:
rivenhk 2017-10-19 20:20:07 +08:00
parent d53c44a066
commit 950f5ae7d7

View File

@ -53,9 +53,9 @@ void SourceReferenceFormatter::printSourceLocation(
int locationLength = endColumn - startColumn; int locationLength = endColumn - startColumn;
if (locationLength > 150) if (locationLength > 150)
{ {
line = line.substr(0, startColumn + 75) + " ... " + line.substr(endColumn); line = line.substr(0, startColumn + 35) + " ... " + line.substr(endColumn - 35);
endColumn = startColumn + 80; endColumn = startColumn + 75;
locationLength = 80; locationLength = 75;
} }
if (line.length() > 150) if (line.length() > 150)
{ {