]> granicus.if.org Git - clang/commit
clang-format: [JS] don't break comments before any '{'
authorMartin Probst <martin@probst.io>
Fri, 3 Aug 2018 13:58:33 +0000 (13:58 +0000)
committerMartin Probst <martin@probst.io>
Fri, 3 Aug 2018 13:58:33 +0000 (13:58 +0000)
commitc4ca20d2bfb9dd85304f4df9a77ef6e9c2a64216
tree278c5684eb6582d82699e5df767c34f34bde94ef
parentc6e47e10cdd68125d6795b9a34caaf03f7945b30
clang-format: [JS] don't break comments before any '{'

Summary:
Previously, clang-format would avoid breaking before the first `{`
found, but then happily break before subsequent '{'s on the line. This
change fixes that by looking for the first location that has no opening
curly, if any.

This fixes the original commit by correcting the loop condition.

This reverts commit 66dc646e09b795b943668179c33d09da71a3b6bc.

Reviewers: krasimir

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338890 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/BreakableToken.cpp
unittests/Format/FormatTestJS.cpp