Eclipse reformat just edited the lines

I am working with Java. If I press Ctrl + Shift + F in Eclipse Helios, it will automatically format the whole file instead of the lines that I edited. This becomes a nightmare during registration when someone else uses a different style in the same file. Is there a way to tell eclipse to only format the affected lines in a file.

+7
code-formatting eclipse
source share
3 answers

If you select a range of lines in the editor, the format will be executed only on this range, if nothing is selected, the entire file will be formatted.

You can change the formatting style used in the / Java / Code Style / Formatter settings.

You can control the formatting and other actions that are performed when saving the file in the Jova / Editor / Save Actions settings.

+2
source share

See the settings page for available save actions.

0
source share

Windows-Preferences-Java-Editor-Save Actions

Format only saved lines. However, if you press Ctrl + shift + fi, don't think that there is a way to save only edited lines.

0
source share

All Articles