Lines 1798-1812
Link Here
|
1798 |
// Append next token inserting a new line if max line is reached |
1798 |
// Append next token inserting a new line if max line is reached |
1799 |
if (lineHasTokens && !firstWord && lastColumn > maxColumn) { |
1799 |
if (lineHasTokens && !firstWord && lastColumn > maxColumn) { |
1800 |
String tokensString = tokensBuffer.toString().trim(); |
1800 |
String tokensString = tokensBuffer.toString().trim(); |
|
|
1801 |
int tokensStringLength = tokensString.length(); |
1801 |
// not enough space on the line |
1802 |
// not enough space on the line |
1802 |
if (hasTextOnFirstLine == 1) { |
1803 |
if (hasTextOnFirstLine == 1) { |
1803 |
printBlockCommentHeaderLine(buffer); |
1804 |
printBlockCommentHeaderLine(buffer); |
1804 |
} |
1805 |
} |
1805 |
if ((this.indentationLevel+tokensString.length()+tokenLength) > maxColumn) { |
1806 |
if ((this.indentationLevel+tokensStringLength+tokenLength) > maxColumn) { |
1806 |
// there won't be enough room even if we break the line before the buffered tokens |
1807 |
// there won't be enough room even if we break the line before the buffered tokens |
1807 |
// So add the buffered tokens now |
1808 |
// So add the buffered tokens now |
1808 |
buffer.append(tokensString); |
1809 |
buffer.append(tokensBuffer); |
1809 |
this.column += tokensString.length(); |
1810 |
this.column += tokensBuffer.length(); |
1810 |
tokensBuffer.setLength(0); |
1811 |
tokensBuffer.setLength(0); |
1811 |
bufferHasNewLine = false; |
1812 |
bufferHasNewLine = false; |
1812 |
bufferHasTokens = true; |
1813 |
bufferHasTokens = true; |
Lines 1820-1826
Link Here
|
1820 |
} |
1821 |
} |
1821 |
if (tokensBuffer.length() > 0) { |
1822 |
if (tokensBuffer.length() > 0) { |
1822 |
buffer.append(tokensString); |
1823 |
buffer.append(tokensString); |
1823 |
this.column += tokensString.length(); |
1824 |
this.column += tokensStringLength; |
1824 |
tokensBuffer.setLength(0); |
1825 |
tokensBuffer.setLength(0); |
1825 |
} |
1826 |
} |
1826 |
buffer.append(this.scanner.source, tokenStart, tokenLength); |
1827 |
buffer.append(this.scanner.source, tokenStart, tokenLength); |