<html><head></head><body data-style="font-family: Monospace;"><div>Hello,</div><div><br></div><div>I was wondering if it is possible to configure clang-format to not break the line before the Java 8 lambda operator. For example,</div><div><br></div><div><pre class="lang-java prettyprint prettyprinted"><code><span class="pln"> entries</span><span class="pun">.</span><span class="pln">forEach</span><span class="pun">(</span><span class="pln">entry </span><span class="pun">-></span><span class="pln">
assertTrue</span><span class="pun">(</span><span class="typ">String</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="str">"Host set includes '%s'"</span><span class="pun">,</span><span class="pln">
entry</span><span class="pun">.</span><span class="pln">getName</span><span class="pun">()),</span><span class="pln">
hostNames</span><span class="pun">.</span><span class="pln">contains</span><span class="pun">(</span><span class="pln">entry</span><span class="pun">.</span><span class="pln">getName</span><span class="pun">())));</span></code></pre></div><div><br></div><div>gets turned into:</div><div><br></div><div><pre class="lang-java prettyprint prettyprinted"><code><span class="pln"> entries</span><span class="pun">.</span><span class="pln">forEach</span><span class="pun">(</span><span class="pln">entry
</span><span class="pun">-></span><span class="pln"> assertTrue</span><span class="pun">(</span><span class="typ">String</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="str">"Host set includes '%s'"</span><span class="pun">,</span><span class="pln">
entry</span><span class="pun">.</span><span class="pln">getName</span><span class="pun">()),</span><span class="pln">
hostNames</span><span class="pun">.</span><span class="pln">contains</span><span class="pun">(</span><span class="pln">entry</span><span class="pun">.</span><span class="pln">getName</span><span class="pun">())));</span></code></pre></div><div><br></div><div>This is my .clang-format:</div><div><br></div><div><font face="monospace">---</font></div><div><font face="monospace">Language: Java</font></div><div><font face="monospace">AccessModifierOffset: -2</font></div><div><font face="monospace">AlignAfterOpenBracket: true</font></div><div><font face="monospace">AlignConsecutiveAssignments: false</font></div><div><font face="monospace">AlignEscapedNewlinesLeft: false</font></div><div><font face="monospace">AlignOperands: false</font></div><div><font face="monospace">AlignTrailingComments: true</font></div><div><font face="monospace">AllowAllParametersOfDeclarationOnNextLine: true</font></div><div><font face="monospace">AllowShortBlocksOnASingleLine: false</font></div><div><font face="monospace">AllowShortCaseLabelsOnASingleLine: false</font></div><div><font face="monospace">AllowShortFunctionsOnASingleLine: All</font></div><div><font face="monospace">AllowShortIfStatementsOnASingleLine: false</font></div><div><font face="monospace">AllowShortLoopsOnASingleLine: false</font></div><div><font face="monospace">AlwaysBreakAfterDefinitionReturnType: None</font></div><div><font face="monospace">AlwaysBreakBeforeMultilineStrings: false</font></div><div><font face="monospace">AlwaysBreakTemplateDeclarations: false</font></div><div><font face="monospace">BinPackArguments: true</font></div><div><font face="monospace">BinPackParameters: false</font></div><div><font face="monospace">BreakBeforeBinaryOperators: false</font></div><div><font face="monospace">BreakBeforeBraces: Attach</font></div><div><font face="monospace">BreakBeforeTernaryOperators: false</font></div><div><font face="monospace">BreakConstructorInitializersBeforeComma: false</font></div><div><font face="monospace">ColumnLimit: 85</font></div><div><font face="monospace">ConstructorInitializerAllOnOneLineOrOnePerLine: false</font></div><div><font face="monospace">ConstructorInitializerIndentWidth: 4</font></div><div><font face="monospace">ContinuationIndentWidth: 8</font></div><div><font face="monospace">DerivePointerAlignment: false</font></div><div><font face="monospace">ExperimentalAutoDetectBinPacking: false</font></div><div><font face="monospace">IndentCaseLabels: false</font></div><div><font face="monospace">IndentWidth: 4</font></div><div><font face="monospace">IndentWrappedFunctionNames: false</font></div><div><font face="monospace">KeepEmptyLinesAtTheStartOfBlocks: true</font></div><div><font face="monospace">MaxEmptyLinesToKeep: 1</font></div><div><font face="monospace">NamespaceIndentation: None</font></div><div><font face="monospace">PenaltyBreakBeforeFirstCallParameter: 19</font></div><div><font face="monospace">PenaltyBreakComment: 300</font></div><div><font face="monospace">PenaltyBreakFirstLessLess: 120</font></div><div><font face="monospace">PenaltyBreakString: 1000</font></div><div><font face="monospace">PenaltyExcessCharacter: 1000000</font></div><div><font face="monospace">PenaltyReturnTypeOnItsOwnLine: 60</font></div><div><font face="monospace">PointerAlignment: Right</font></div><div><font face="monospace">SpaceAfterCStyleCast: false</font></div><div><font face="monospace">SpaceBeforeAssignmentOperators: true</font></div><div><font face="monospace">SpaceBeforeParens: ControlStatements</font></div><div><font face="monospace">SpaceInEmptyParentheses: false</font></div><div><font face="monospace">SpacesBeforeTrailingComments: 1</font></div><div><font face="monospace">SpacesInAngles: false</font></div><div><font face="monospace">SpacesInContainerLiterals: true</font></div><div><font face="monospace">SpacesInCStyleCastParentheses: false</font></div><div><font face="monospace">SpacesInParentheses: false</font></div><div><font face="monospace">SpacesInSquareBrackets: false</font></div><div><font face="monospace">TabWidth: 4</font></div><div><font face="monospace">UseTab: Never</font></div><div><font face="monospace">...</font></div><div></div><div><br></div><div class="-x-evo-signature-wrapper"><span><pre>--
<html> <body> <div style="font-family: sans-serif; font-size: 12px; width: 600px; border-width: 1px 0px 0px 0px; border-color: #b0b0b0; border-style: solid; padding: 10px;"> <table cellpadding="0" cellspacing="0" style="font-family: sans-serif; font-size: 12px; width: 100%;"> <tr> <td style="text-align: left; vertical-align: top; width: 545px;"> <div style="font-size: 14px; font-weight: bold;">Skyler Hawthorne</div> <div>Research Systems Software Engineer</div> </td> <!-- OpenDNS logo --> <td style="text-align: left; vertical-align: top; width: 101px; padding-left: 10px;"> <a href="http://opendns.com"><img alt="OpenDNS" src="http://images.disthost.opendns.com/signature/opendns_cisco.png" /></a> </td> </tr> </table> </div> <div style="font-family: sans-serif; font-size: 12px; width: 600px; border-width: 1px 0px 0px 0px; border-color: #b0b0b0; border-style: solid; padding: 10px;"> <table cellpadding="0" cellspacing="0" style="font-family: sans-serif; font-size: 12px; width: 100%;"> <tr> <td style="text-align: left; vertical-align: top; width: 4em;"> <span style="font-weight: bold; color: #909090;">Mobile:</span><br /> </td> <td style="text-align: left; vertical-align: top;"> +1-510-371-4123<br /> </td> <td style="text-align: left; vertical-align: top; padding-left: 10px; width: 4em;"> <span style="font-weight: bold; color: #909090;">Email:</span><br /> <span style="font-weight: bold; color: #909090;">IM:</span><br /> </td> <td style="text-align: left; vertical-align: top;"> <a href="mailto:skhawtho@cisco.com" style="text-decoration: none; color: #000">skhawtho@cisco.com</a><br /> <a href="xmpp:skhawtho%40cisco.com?message" style="text-decoration: none; color: #000;">skhawtho@cisco.com</a> (XMPP)<br /> </td> <!-- SS:address_135_bluxome --> <td style="text-align: left; vertical-align: top; padding-left: 10px;"> <a target="_blank" href="http://opendns.com/" style="color: #f07000;"><b>OpenDNS</b></a><br> <a target="_blank" href="http://maps.google.com/maps?q=135+Bluxome+Street%2CSan+Francisco%2CCA+94107%2CUnited+States&hl=en" style="text-decoration: none; color: #000000">135 Bluxome St<br />San Francisco, CA 94107<br />United States</a> </td> <!-- SE:address_135_bluxome --> <td style="text-align: right; vertical-align: top; width: 82px;"> <a href="http://github.com/opendns" title="Github"><img alt="GH" src="http://images.disthost.opendns.com/signature/github.png" /></a> </td> </tr> </table> </div> <br /> </body></html></pre></span></div></body></html>