<div style="white-space:pre-wrap"></div><div dir="auto" style="word-wrap:break-word">Thanks for the response Daniel,<div><br></div><div>Could you guide me on where can I look inside clang-format implementation to see how clang-format currently handles lambdas in other languages, so that I may try to implement the same functionality for Objective-C case? </div><div><br></div><div>Besides that, I have one more question, which is somewhat related to topic.</div><div><br></div><div>When I try to use clang-format to format the following simple code:<br><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">- (void)asdf {</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">    </span>[UIView animateasdfasdf:0 animations:^{ }];</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">     </span>[UIView animations:^{ } done:YES];</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">      </span>[UIView animations:^{ } completion:^{ }];</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">       </span>[UIView testasdfasdfsd:YES animations:^{ } completion:^{ }];</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">    </span>[UIView animations:^{ } tessd:YES completion:^{ }];</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">}</div></div><div><br></div><div>Output is the following:<br><br><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><div style="margin:0px;line-height:normal">- (void)asdf {</div><div style="margin:0px;line-height:normal">  [UIView animateasdfasdf:0</div><div style="margin:0px;line-height:normal">               animations:^{</div><div style="margin:0px;line-height:normal">               }];</div><div style="margin:0px;line-height:normal">  [UIView animations:^{</div><div style="margin:0px;line-height:normal">  }</div><div style="margin:0px;line-height:normal">                done:YES];</div><div style="margin:0px;line-height:normal">  [UIView animations:^{</div><div style="margin:0px;line-height:normal">  }</div><div style="margin:0px;line-height:normal">      completion:^{</div><div style="margin:0px;line-height:normal">      }];</div><div style="margin:0px;line-height:normal">  [UIView testasdfasdfsd:YES</div><div style="margin:0px;line-height:normal">      animations:^{</div><div style="margin:0px;line-height:normal">      }</div><div style="margin:0px;line-height:normal">      completion:^{</div><div style="margin:0px;line-height:normal">      }];</div><div style="margin:0px;line-height:normal">  [UIView animations:^{</div><div style="margin:0px;line-height:normal">  }</div><div style="margin:0px;line-height:normal">      tessd:YES</div><div style="margin:0px;line-height:normal">      completion:^{</div><div style="margin:0px;line-height:normal">      }];</div><div style="margin:0px;line-height:normal">}</div></div><span><div><span><br></span></div></span></div></div><div dir="auto" style="word-wrap:break-word"><div><span>I think clang-format somehow decides to not use colon alignment but align using `</span>ContinuationIndentWidth` where there are more than one block parameters.</div><div><span>Is this an intended behavior? Seems like a bug to me.</span></div><div><span><br></span></div><div><span>PS : I'm using the <span></span>default LLVM configuration for the above case.</span></div></div><div dir="auto" style="word-wrap:break-word"><div><span><blockquote type="cite">On 13 Dec 2015, at 16:42, Daniel Jasper <<a href="javascript:_e(%7B%7D,'cvml','djasper@google.com');" target="_blank">djasper@google.com</a>> wrote:<br><br></blockquote></span></div></div><div dir="auto" style="word-wrap:break-word"><div><span><blockquote type="cite">Nope, this behavior isn't currently implemented. I agree that it might make sense, as it is similar to how clang-format treats lambdas at the end of several other parameters.<br><br>On Fri, Dec 11, 2015 at 4:08 PM, Yavuz Nuzumlalı <<a href="javascript:_e(%7B%7D,'cvml','cfe-dev@lists.llvm.org');" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br>Hi everyone,<br><br>I'm experiencing a problem with clang-format for my code.<br><br>I'm using ColumnLimit as 120. When I write some code like this:<br><br>[self testMethod:15 withBlock:^{<br><span style="white-space:pre-wrap">    </span>NSLog(@"asdfasdf");<br><span style="white-space:pre-wrap"> </span>NSLog(@"asdfasdf");<br><span style="white-space:pre-wrap"> </span>NSLog(@"asdfasdf");<br><span style="white-space:pre-wrap"> </span>NSLog(@"asdfasdf");<br>}];<br><br>This code would be converted to this by clang-format:<br><br>[self testMethod:15<br>       withBlock:^{<br><span style="white-space:pre-wrap">   </span>       NSLog(@"asdfasdf");<br><span style="white-space:pre-wrap">      </span>       NSLog(@"asdfasdf");<br><span style="white-space:pre-wrap">      </span>       NSLog(@"asdfasdf");<br><span style="white-space:pre-wrap">      </span>       NSLog(@"asdfasdf");<br><span style="white-space:pre-wrap">      </span>   }];<br><br>That seems wrong to me because the method call before block variable actually fits in width of 120. I guess this is because clang-format behaves above code as a single method call and assumes it as one line. But I really want to not split the method like this because it feels weird.<br><br>Is there a way to accomplish this with current system?<br><br>I put my configuration file as an attachment.<br><br>Best<br><br><br>_______________________________________________<br>cfe-dev mailing list<br><a href="javascript:_e(%7B%7D,'cvml','cfe-dev@lists.llvm.org');" target="_blank">cfe-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br><br><br></blockquote></span></div></div>