I'm using the Eclipse C/C++ formatter and run into an issue where it removes indents on line wrapping on the second save. For example I'll write some code:
int array[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
It'll then format it to (exaggerated line limit):
int array[] = {1, 2, 3, 4,
5, 6, 7, 8, 9};
I'll then change something else in the file and format again. It now removes the line wrapping indentation on the original, unchanged code:
int array[] = {1, 2, 3, 4,
5, 6, 7, 8, 9};
I've tried messing with the settings but can't find what could stop it. I'm expecting it to stay line wrapped with the indentation on wrapped lines (what's seen after the first formatting). I don't want to use the "on/off tags" as i think they're bulky. Is there an option in the formatter that can stop this?
For clarification I'm using STM32CubeIDE version 1.18.0, and using a modified K&R [built in] profile for the formatter, but it looks like the issue is in the unmodified profile as well.