From fa55c6ebf5bde5f139f6ab6835bd5f4f2dbd4da2 Mon Sep 17 00:00:00 2001 From: bananeweizen Date: Tue, 20 Dec 2005 00:58:53 +0000 Subject: [PATCH] bug 1274348, superfluous newline at file end on formatting source --- .../phpdt/internal/formatter/CodeFormatter.java | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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 6003bd0..5d8db07 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 @@ -271,7 +271,7 @@ public class CodeFormatter implements ITerminalSymbols, ICodeFormatter { outputLine(currentString, false, currentLineIndentationLevel, 0, -1, null, 0); } int scannerSourceLength = scanner.source.length; - if (scannerSourceLength > 2) { + if ((scannerSourceLength > 2) && (scanner.startPosition < scannerSourceLength)) { if (scanner.source[scannerSourceLength - 1] == '\n' && scanner.source[scannerSourceLength - 2] == '\r') { formattedSource.append(options.lineSeparatorSequence); increaseGlobalDelta(options.lineSeparatorSequence.length - 2); -- 1.7.1