Reputation: 599
My problem is, when I comment out a line using Ctrl + /,
// comment
and then auto-format the code,
// comment
the comment will still contain whitespaces after the "//" that I wouldn't want to keep.
I've already checked the Settings>Editor>Java>Wrapping and Braces options, and also the other tabs.
Thanks in advance.
Upvotes: 5
Views: 1517
Reputation: 116
I have just solved this problem.
Code Style -> Java -> Code Generation
There is a "Comment Code" and deselect the "Line comment at first column"
Code Style -> Java -> Wrapping and Braces
There is a "Keep when reformatting" and deselect the "Comment at first column"
As follows
I think your problem can be solved.
Upvotes: 10
Reputation: 2208
To apply identation to a document press Ctrl + Alt + L (Option + Command + L in Mac)
But the only way, once you have few comments with that "problem", I guess is to replace ('// ' by '//') (Shortcut to replace: Ctrl + Shift + R)
Hope it hepls.
Upvotes: 0