Bug 332737 - [typing] pasting line comments at column 0 eats space before text
Summary: [typing] pasting line comments at column 0 eats space before text
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 minor with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 335085 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-12-16 08:58 EST by Stephan Herrmann CLA
Modified: 2023-08-19 11:37 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2010-12-16 08:58:53 EST
This is 3.7M4, a fresh Java project with simple Java class:

public class CommentFormatting {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=332637 
// Dead Code detection removing code that isn't dead
public void test() {
	
}
}

Now select the method test() including the preceding line comments
and paste it immediately after the method. The result will be:

public class CommentFormatting {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=332637 
// Dead Code detection removing code that isn't dead
public void test() {
	
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=332637 
//Dead Code detection removing code that isn't dead
public void test() {
	
}
}

The problem only occurs if the comment is pasted behind a method that
is not indented.
Comment 1 Deepak Azad CLA 2011-01-22 06:47:58 EST
*** Bug 335085 has been marked as a duplicate of this bug. ***
Comment 2 Stephan Herrmann CLA 2012-01-12 07:37:03 EST
Still relevant in HEAD. In most of JDT/Core's test classes this means
cut/copy and paste deletes a space which needs to be re-added manually
or risk wasting cycles during code review.
Comment 3 Eclipse Genie CLA 2019-08-31 13:25:55 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 4 Stephan Herrmann CLA 2019-08-31 13:32:09 EDT
This happens. No big deal but causes a little hick-up in the editing flow.
Comment 5 Eclipse Genie CLA 2021-08-23 15:26:33 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 6 Eclipse Genie CLA 2023-08-19 11:37:16 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.