Removing trailing white space for all lines has already been answered: How to auto-remove trailing whitespace in Eclipse?
However, I haven't been able to try to find a way to do so for only the lines that I edited.
Please don't mark this as duplicate of the above because the answer is not in the above and the question is now 5 years old and kinda forgotten about.
The reason is that I want to maintain my commits clean, so that you can see which lines I actually edited. Otherwise there is a big mess and you can't tell what I've done. I would then deal with remaining trailing whitespace in other commits.
Has anyone been able to do this?
Things tried:
Only has option to remove all lines
Removes on all lines.
Removes on all lines.
Enable on save formatting for edited lines only:
SaveActions>Perform the selected actions on save>Format source code>Format edited lines
. Tested it with this settings:
With this settings whitespaces have been removed only for edited lines. There is no option to remove trailing white spaces in formatter settings so I guess it is doing that by default.
I tested it with Eclipse 4.3.2 (Kepler SR2)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With