Bug 107128 [typing] Move lines destroys indentation of outcommented code
I20050811-1530 Move lines destroys the indentation of code that has been commented out. IMO, Move lines should never try to be smart about the contents of a commented section. It should just add/remove whitespace in front of the // (same behavior as when moving other statements). public class Klass { int bar; // void foo() { // System.out.println("foo"); // } } - select the 3 commented lines - press Alt+Up -> document looks like this (note the removed tab in fromt of System.out.pr...): public class Klass { // void foo() { // System.out.println("foo"); // } int bar; }
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/IndentUtil.java
private static int getLeftMostLine(IDocument document, ILineRange lines, int tabSize) throws BadLocationException {
		int numberOfLines= lines.getNumberOfLines();
		int first= lines.getStartLine();
		int minLine= -1;
		int minIndent= Integer.MAX_VALUE;
		for (int line= 0; line < numberOfLines; line++) {
			int length= computeVisualLength(getCurrentIndent(document, line + first), tabSize);
			if (length < minIndent) {
				minIndent= length;
				minLine= line;
			}
		}
		return minLine;
	}
	private static IndentResult reuseOrCreateToken(IndentResult token, int numberOfLines) {
		if (token == null)
			token= new IndentResult(new boolean[numberOfLines]);
		else if (token.commentLinesAtColumnZero == null)
			token.commentLinesAtColumnZero= new boolean[numberOfLines];
		else if (token.commentLinesAtColumnZero.length != numberOfLines) {
			boolean[] commentBooleans= new boolean[numberOfLines];
			System.arraycopy(token.commentLinesAtColumnZero, 0, commentBooleans, 0, Math.min(numberOfLines, token.commentLinesAtColumnZero.length));
			token.commentLinesAtColumnZero= commentBooleans;
		}
		return token;
	}
	
	/**
	 * Indents a single line using the java heuristic scanner. Javadoc and multi
	 * line comments are indented as specified by the