Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 65791 - Copy/cut of folded code doesn't work
Summary: Copy/cut of folded code doesn't work
Status: RESOLVED DUPLICATE of bug 65955
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-04 15:40 EDT by John P. A. Verhaeg CLA
Modified: 2004-06-15 12:13 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John P. A. Verhaeg CLA 2004-06-04 15:40:02 EDT
If I copy some code that contains within it some folded code, only the 
unfolded code makes it to the clipboard.  So if I have a couple of methods 
that I want to copy, but the JavaDocs before the method are folded, then when 
I paste the code somewhere else, the entire method ends up as a comment since 
the only part of the folded comment that was showing didn't include the 
comment end characters (*/).
Comment 1 Nico Seessle CLA 2004-06-14 07:34:42 EDT
My little research against 3.0RC2:

Using the following code: 

public class FoldCopyBugs {
    private void foo() {
        Runnable r = new Runnable() {
            public void run() {
                System.out.println("foo");
            }
        };
    }
}

When "Runnable r ..." is "folded", i.e. shows as

public class FoldCopyBugs {
    private void foo() {
        Runnable r = new Runnable() {[...]
    }
}

If you select the line "Runnable r..." and press

- Ctrl-Insert (i.e. Copy on Windows) only "Runnable r = new Runnable() { " gets
copied to the clipboard.

- Ctrl-C the whole Runnable-block gets copied

- Shift-Delete (Cut on Windows) the block gets expande, but only the "Runnable
.."-line is copied

- Ctrl-X the complete block gets copied.
Comment 2 John P. A. Verhaeg CLA 2004-06-14 10:00:01 EDT
Thanks Nico.  That jives with how I normally do cut/copy/paste: I've always 
had a tendency to use the Shift-Delete/Ctrl-Insert/Shift-Insert method.  Glad 
there's a workaround.
Comment 3 Dani Megert CLA 2004-06-15 12:13:23 EDT

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