How to have eclipse add line comments at the indent instead at the beginning of the line?

Viewed 1085

When running Toggle Comment on one or more lines of code, Eclipse adds the comment (//) at the beginning of the line. Is it possible to have Eclipse add the line comment where the code is indented at instead?

This can be fixed by running Source > Format but it would be nice if it can be done automatically when Toggling Comment.

1 Answers

A workaround solution is to have Eclipse do the formatting automatically: you can enable this through the "Save Action" preference.

Related