Closed as duplicate of#18815
Closed as duplicate of#18815
Description
Unless I'm missing it, clang-format has no option to keep whitespace-only lines that keep indentation level with the code.
The bullets represent spaces. I'm looking for a way to not have the indentation-only line 3 be changed:
if (true) {
••••int myNum = 2;
••••
••••myNum = 4;
}
Always becomes:
if (true) {
••••int myNum = 2;
••••myNum = 4;
}
Xcode has an option (default I think) to create/preserve such indentation, in Xcode > Settings > Text Editing > Editing:
While Editing: ☑ Automatically trim trailing spaces
☑ Including whitespace-only lines
Xcode's "re-indent" command also adds such indentation, and so all my code has such indentation, hence I'd like clang-format to not touch it.
Having this option would make it easier for Xcode users to adopt clang-format in their workflow.
(I've seen others want the same, ex: https://stackoverflow.com/questions/32619716/clang-format-is-removing-all-the-indent-spaces-on-my-empty-lines)