From 43af0d354bc876a929caad0002588805bcf153f5 Mon Sep 17 00:00:00 2001 From: Albert Meltzer <7529386+kitbellew@users.noreply.github.com> Date: Wed, 4 Mar 2020 10:19:55 -0800 Subject: [PATCH] Router: remove currently unused comma split Follow-on to #1722. --- .../shared/src/main/scala/org/scalafmt/internal/Router.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scalafmt-core/shared/src/main/scala/org/scalafmt/internal/Router.scala b/scalafmt-core/shared/src/main/scala/org/scalafmt/internal/Router.scala index 2bea0c017f..e003354e24 100644 --- a/scalafmt-core/shared/src/main/scala/org/scalafmt/internal/Router.scala +++ b/scalafmt-core/shared/src/main/scala/org/scalafmt/internal/Router.scala @@ -924,11 +924,12 @@ class Router(formatOps: FormatOps) { Split(Space, 1, policy = multiLine) ) }).map(_.onlyFor(SplitTag.OneArgPerLine)) - def oneLineBody = open.pos.endLine == close.pos.startLine Seq( Split(Space, 0), Split(Newline, 0) - .onlyIf(newlines != 0 && oneLineBody) + .onlyIf(oneArgPerLineSplits.isEmpty) + .onlyIf(newlines != 0) + .onlyIf(open.pos.endLine == close.pos.startLine) .withOptimalToken(close, killOnFail = true) .withPolicy(SingleLineBlock(close)) ) ++ oneArgPerLineSplits