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/actions/IndentAction.java
/**
	 * Returns the possibly project-specific core preference defined under <code>key</code>, or
	 * def if the value is not a integer.
	 * 
	 * @param key the key of the preference
	 * @param def the default value
	 * @return the value of the preference
	 * @since 3.1
	 */
	private int getCoreFormatterOption(String key, int def) {
		try {
			return Integer.parseInt(getCoreFormatterOption(key));
		} catch (NumberFormatException e) {
			return def;
		}
	}
	/**
	 * Returns the <code>IJavaProject</code> of the current editor input, or
	 * <code>null</code> if it cannot be found.
	 * 
	 * @return the <code>IJavaProject</code> of the current editor input, or
	 *         <code>null</code> if it cannot be found
	 * @since 3.1
	 */
	private IJavaProject getJavaProject() {
		ITextEditor editor= getTextEditor();
		if (editor == null)
			return null;
		
		ICompilationUnit cu= JavaPlugin.getDefault().getWorkingCopyManager().getWorkingCopy(editor.getEditorInput());