From 7c31b952e309ff5d93cfd3b2fa2348e24faf2983 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Fri, 15 Mar 2013 15:31:13 -0700 Subject: [PATCH] Cosmetics. --- .../cdt/internal/formatter/Scribe.java | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/Scribe.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/Scribe.java index e073278a6ee..f8b38a00f31 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/Scribe.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/Scribe.java @@ -464,8 +464,8 @@ public class Scribe { printIndentationIfNecessary(buffer); buffer.append(lineSeparator); } - lastNumberOfNewLines+= linesNumber; - line+= linesNumber; + lastNumberOfNewLines += linesNumber; + line += linesNumber; column= 1; needSpace= false; pendingSpace= false; @@ -475,8 +475,8 @@ public class Scribe { printIndentationIfNecessary(buffer); buffer.append(lineSeparator); } - lastNumberOfNewLines+= linesNumber; - line+= linesNumber; + lastNumberOfNewLines += linesNumber; + line += linesNumber; column= 1; needSpace= false; pendingSpace= false; @@ -491,8 +491,8 @@ public class Scribe { printIndentationIfNecessary(buffer); buffer.append(lineSeparator); } - lastNumberOfNewLines+= realNewLineNumber; - line+= realNewLineNumber; + lastNumberOfNewLines += realNewLineNumber; + line += realNewLineNumber; column= 1; needSpace= false; pendingSpace= false; @@ -777,8 +777,7 @@ public class Scribe { needSpace= false; } if (startOffset + length < currentPosition) { - // don't move backwards - return; + return; // Don't move backwards } boolean savedPreserveNL= preserveNewLines; boolean savedSkipOverInactive= skipOverInactive; @@ -994,7 +993,7 @@ public class Scribe { addReplaceEdit(start, previousStart - 1, String.valueOf(buffer)); } else { - column+= (nextCharacterStart - previousStart); + column += (nextCharacterStart - previousStart); } isNewLine= false; } @@ -1041,7 +1040,7 @@ public class Scribe { column= 1; line++; } else { - column+= (nextCharacterStart - previousStart); + column += (nextCharacterStart - previousStart); } isNewLine= false; } @@ -1513,7 +1512,7 @@ public class Scribe { while (column <= indentationLevel - indentationLevel % tabLength) { buffer.append('\t'); int complement= tabLength - ((column - 1) % tabLength); // amount of space - column+= complement; + column += complement; needSpace= false; } while (column <= indentationLevel) { @@ -1540,7 +1539,7 @@ public class Scribe { if (column <= columnForLeadingIndents) { if ((column - 1 + tabLength) <= indentationLevel) { buffer.append('\t'); - column+= tabLength; + column += tabLength; } else if ((column - 1 + indentationSize) <= indentationLevel) { // print one indentation for (int i= 0, max= indentationSize; i < max; i++) { @@ -1563,7 +1562,7 @@ public class Scribe { while (column <= indentationLevel) { if ((column - 1 + tabLength) <= indentationLevel) { buffer.append('\t'); - column+= tabLength; + column += tabLength; } else if ((column - 1 + indentationSize) <= indentationLevel) { // print one indentation for (int i= 0, max= indentationSize; i < max; i++) {