0

I have an if condition of the following form:

if ((foo == cond1)
   && (bar == cond2))
{
  // Code
}

Without the break inside the condition, the line is not too long for clang-format. Thus it is corrected as:

if ((foo == cond1) && (bar == cond2))
{
  // Code
}

How can I let clang-format accept extra breaks in this situation (and if possible, other contexts) ?

I currently use LLVM's default configuration.

  • Please read: [Clang-format line breaks](https://stackoverflow.com/questions/33656800/clang-format-line-breaks), and tell what info you are missing.... – Luuk Aug 28 '23 at 13:06
  • I didn't stumble across this post, the proposed solutions are not satisfying but I understand that there aren't satisfying solutions. I guess I will accept the generic formatting instead of these ad-hoc ones. – Yuni Tsukiyama Aug 28 '23 at 14:26

0 Answers0