| Pasting comments aligns with text, not slashes [message #878509] |
Tue, 29 May 2012 09:07  |
Conan Cook Messages: 1 Registered: May 2012 |
Junior Member |
|
|
Hi,
I've got a problem which has been around for some time in Eclipse 3.7.1, Indigo Service Release 1, Build id: 20110916-0149. I'm on Windows 7. When I paste a comment in a Java source file, the Eclipse formatter aligns it incorrectly at the start of the text in the comment, rather than the comment slashes themselves. For example, if I copy this:
// This is a comment
System.out.println("I have a comment");
And paste it to an indented location, It is incorrectly indented like this:
public void aMethod() {
// This is a comment
System.out.println("I have a comment");
}
As you can see, the indentation is correct in respect to the text of the comment, but the slashes are in the wrong place. This only occurs if I select the original text from the start of the text, not the start of the line (i.e. I miss out any leading tabs - although it also happens if there are no leading tabs on any of the source lines).
I've googled around the internets and this forum, and can't find anything discussing this issue, mainly because there appears to have been another issue with pasting comments related to auto-commented code. I am using a custom code formatter in Eclipse, but have confirmed that this happens with the built-in Eclipse formatter also.
Does anyone know what setting controls this, or how I can encourage Eclipse to paste so the result looks like this?
public void aMethod() {
// This is a comment
System.out.println("I have a comment");
}
Thanks very much,
Conan
[Updated on: Wed, 30 May 2012 04:57] Report message to a moderator
|
|
|