Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 131136

Summary: Unindent when pasting a comment line
Product: [Eclipse Project] JDT Reporter: cdtogea <eclipse>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description cdtogea CLA 2006-03-09 12:28:42 EST
I want to paste a comment line inside a loop of some kind. Consider this scenario:

class A {
    ...
    private void method1() {
        ...
        while (...) {
            <do-something>
        }
    }

    private void method2() {
        ...
        while (...) {
            // a comment
            <do-something>
        }
    }
}

What I want to do is to copy the comment line from method2 into method1 as well
so I mark the comment and do a Ctrl+C. Note that I marke only this text "// a comment", that is no white-space before or after the comment. I place the cursor at the write place inside method1 and do a Ctrl+C. I expect this:

    private void method1() {
        // a comment
        ...
        while (...) {
            <do-something>
        }
    }

but I get this:

    private void method1() {
//      a comment
        ...
        while (...) {
            <do-something>
        }
    }

It's very annoying.
Comment 1 Dani Megert CLA 2006-03-13 09:15:42 EST

*** This bug has been marked as a duplicate of 65841 ***