eclipse reformat only edited lines
Asked Answered
I

3

10

I am working with Java. If I hit Ctrl+Shift+F in Eclipse Helios, it will auto format the entire file instead of the lines I edited. This becomes a nightmare at the time of check in when someone else uses a different style on the same file. Is there a way to tell eclipse to only format the touched lines in a file.

Irritant answered 5/9, 2013 at 18:24 Comment(0)
B
4

Windows-Preferences-Java-Editor-Save Actions

Format only saved lines. However, if you hit Ctrl+shift+f i don't think there is a way that only edited lines will be saved.

Brighton answered 30/1, 2014 at 12:5 Comment(0)
P
3

If you select a range of lines in the editor then the format is done just on that range, if there is nothing selected the whole file is formatted.

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

You can control formatting and other actions done when saving a file in the Jova / Editor / Save Actions preferences.

Perpetrate answered 6/9, 2013 at 9:21 Comment(0)
R
0

Look at the preferences page for the available Save Actions.

Raynaraynah answered 5/9, 2013 at 18:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.