Skip to content

Commit

Permalink
Router: binpack callsite: Spc for attached comment
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed May 10, 2024
1 parent 51dbd9f commit efc79ed
Showing 1 changed file with 1 addition and 2 deletions.
Expand Up @@ -1187,7 +1187,6 @@ class Router(formatOps: FormatOps) {
val singleLineOnly = style.binPack.literalsSingleLine &&
flags.literalArgList

val rightIsComment = right.is[T.Comment]
val scalaJsStyleNL = flags.scalaJsStyle && beforeClose.hasBreak
val nlOnly = flags.dangleForTrailingCommas ||
flags.configStyle != ConfigStyle.None ||
Expand Down Expand Up @@ -1317,7 +1316,7 @@ class Router(formatOps: FormatOps) {
.getOrElse(decideNewlinesOnlyBeforeCloseOnBreak(close))
}
val nlMod =
if (rightIsComment && nlOnly) getMod(ft)
if (nlOnly && noBreak() && right.is[T.Comment]) Space
else NewlineT(alt = if (singleLineOnly) Some(NoSplit) else None)
val nlSplit = Split(nlMod, bracketPenalty * (if (oneline) 4 else 2))
.withIndent(indent)
Expand Down

0 comments on commit efc79ed

Please sign in to comment.