HomePhabricator

[clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set

Authored by Typz on May 22 2017, 2:23 AM.

Description

[clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set

Summary:
Even when BreakBeforeBinaryOperators is set, AlignOperands kept
aligning the beginning of the line, even when it could align the
actual operands (e.g. after an assignment).

With this patch, the operands are actually aligned, and the operator
gets aligned with the equal sign:

int aaaaa = bbbbbb
          + cccccc;

This not happen in tests, to avoid 'breaking' the indentation:

if (aaaaa
    && bbbbb)
  return;

Reviewers: krasimir, djasper, klimek, MyDeveloperDay

Reviewed By: MyDeveloperDay

Subscribers: MyDeveloperDay, acoomans, cfe-commits, klimek

Tags: #clang, #clang-format

Differential Revision: https://reviews.llvm.org/D32478