/* aaaaaaaa a
- a*/
Now becomes
/* aaaaaaaa
- a a*/
instead of
/* aaaaaaaa
- a
- a*/
This is implemented by glueing the next line on while fixing whitespace
and adding another break if that brings us over the column limit again.
We also have heuristics to avoid making existing comments worse:
- Only reflow when the existing comment is already over the column limit
- Don't reflow when there's an empty line (to avoid breaking paragraphs)
- Don't reflow when there's a non-alphanumeric char at the beginning of the next line. This is a weak attempt to avoid mangling ASCII art.
I intend to do the same thing for line comments, but that will require
changes to other parts of clang-format first.
For posterity, from in-person chat:
Currently, this does the same as before when we're in DryRun mode, and only wraps when we apply the changes. Instead, we'll need to make this work with the DryRun mode for optimization.