From: bananeweizen Date: Tue, 10 Jan 2006 21:07:55 +0000 (+0000) Subject: request 1123108: keep strings on multiple lines during formatting X-Git-Url: http://secure.phpeclipse.com?hp=e2d72d7a190724245b8aae05416a9c14e2ed84dd request 1123108: keep strings on multiple lines during formatting --- diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/CodeFormatter.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/CodeFormatter.java index 09e3add..449375c 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/CodeFormatter.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/CodeFormatter.java @@ -523,8 +523,12 @@ public class CodeFormatter implements ITerminalSymbols, ICodeFormatter { // if the comment is between parenthesis, there is no blank line // preservation // (if it's a one-line comment, a blank line is added after it). - if (((pendingNewLines > 0 && (!isComment(token))) - || (newLinesInWhitespace > 0 && (openParenthesisCount <= 1 && isComment(token))) || (previousCompilableToken == TokenNameLBRACE && token == TokenNameRBRACE)) + if (( + (pendingNewLines > 0 && (!isComment(token))) + || (newLinesInWhitespace > 0 && (openParenthesisCount <= 1 && isComment(token))) + || (previousCompilableToken == TokenNameLBRACE && token == TokenNameRBRACE) + || (newLinesInWhitespace > 0 && previousCompilableToken == TokenNameDOT) + ) && token != Scanner.TokenNameWHITESPACE) { // Do not add newline & indent between an adjoining close brace and // close paren. Anonymous inner classes may use this form. @@ -799,6 +803,7 @@ public class CodeFormatter implements ITerminalSymbols, ICodeFormatter { } break; case TokenNameDOT: + space(); pendingSpace = false; break; case TokenNameSEMICOLON: @@ -1267,7 +1272,6 @@ public class CodeFormatter implements ITerminalSymbols, ICodeFormatter { case TokenNameLPAREN: case TokenNameNOT: case TokenNameTWIDDLE: - case TokenNameDOT: case 0: // no token case TokenNameWHITESPACE: