]> granicus.if.org Git - clang/commit
clang-format: [JS] don't break comments before any '{'
authorMartin Probst <martin@probst.io>
Fri, 3 Aug 2018 09:34:41 +0000 (09:34 +0000)
committerMartin Probst <martin@probst.io>
Fri, 3 Aug 2018 09:34:41 +0000 (09:34 +0000)
commit5ddb2e4ee13d75b7d4b00d5c38f7a81c98b6c14f
treede7a081206b2fc41b9aac664ddac4c2a3cc433f8
parent6578ee69bfa568fd1aeb378113d527711efac9bd
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.

Reviewers: krasimir

Subscribers: cfe-commits

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

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