forked from OSchip/llvm-project
[clang-format/ObjC] Prohibit breaking after a bracket opening ObjC method expression
Summary: Don't break after a "[" opening an ObjC method expression. Tests are added in D48719 where formatting is improved (to avoid adding and changing tests immediately). Reviewers: benhamilton, klimek Reviewed By: benhamilton Subscribers: acoomans, cfe-commits Differential Revision: https://reviews.llvm.org/D48718 llvm-svn: 336519
This commit is contained in:
parent
27a5579f15
commit
e7c4b5901e
|
@ -321,6 +321,9 @@ bool ContinuationIndenter::canBreak(const LineState &State) {
|
|||
State.Stack.back().NoLineBreakInOperand)
|
||||
return false;
|
||||
|
||||
if (Previous.is(tok::l_square) && Previous.is(TT_ObjCMethodExpr))
|
||||
return false;
|
||||
|
||||
return !State.Stack.back().NoLineBreak;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue