[PATCH] D53072: [clang-format] Introduce the flag which allows not to shrink lines

Daniel Jasper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 11 08:14:38 PST 2019


djasper added a comment.

Ok, but this behavior is still intended. You are setting clang-format to a format where it is breaking after binary operators and then added a break before a binary operator. clang-format assumes that this is not intended and that you will want this cleaned up.

E.g.:

  $ cat /tmp/format.cc
  if ( a
        && b) {
  }
  
  $ clang-format -style="{ColumnLimit: 0, BreakBeforeBinaryOperators: All}" /tmp/format.cc
  if (a
      && b) {
  }
  
  $ clang-format -style="{ColumnLimit: 0}" /tmp/format.cc
  if (a && b) {
  }

I believe that this behavior is right and we should not work around it with an additional flag.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D53072/new/

https://reviews.llvm.org/D53072





More information about the cfe-commits mailing list