Bug 43364 [typing] new line insertion sometimes goes wrong!
try and put a new line between the two variable declarations. It will shift the second variable declaration to line up with "c". ------------------------------------------------------------ public class A { private static final String[] var = new String[] { "a", "b", "c", "d"}; private static final int var2 = 4; //press enter at beginning of this line } ------------------------------------------------------------
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/JavaHeuristicScanner.java
break;
		}
		return TokenIDENT;
	}
	/**
	 * Returns the position of the closing peer character (forward search). Any scopes introduced by opening peers
	 * are skipped. All peers accounted for must reside in the default partition.
	 * 
	 * <p>Note that <code>start</code> must not point to the opening peer, but to the first
	 * character being searched.</p>
	 * 
	 * @param start the start position
	 * @param openingPeer the opening peer character (e.g. '{')
	 * @param closingPeer the closing peer character (e.g. '}')
	 * @return the matching peer character position, or <code>NOT_FOUND</code>
	 */
	public int findClosingPeer(int start, final char openingPeer, final char closingPeer) {
		Assert.isNotNull(fDocument);
		Assert.isTrue(start >= 0);
		
		try {
			int depth= 1;
			start -= 1;
			while (true) {
				start= scanForward(start + 1, UNBOUND, new CharacterMatch(new char[] {openingPeer, closingPeer}));
				if (start == NOT_FOUND)
					return NOT_FOUND;
					
				if (fDocument.getChar(start) == openingPeer)
					depth++;