-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Align lines with different columns count #1785
Conversation
For pretty `% Test` block formatting: ``` libraryDependencies ++= Seq( "io.get-coursier" % "interface" %% "0.0.17", "com.geirsson1111111" %%% "metaconfig-core" % metaconfigV % Test, "org.scalacheck" %% "scalacheck" % sclacheckV % Test ) ```
@@ -663,7 +663,7 @@ class FormatWriter(formatOps: FormatOps) { | |||
val units = Vector.newBuilder[AlignmentUnit] | |||
while (i < block.length) { | |||
val line = block(i) | |||
if (line.lengthCompare(column) == 1) { | |||
if (column < line.length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, if you like lengthCompare
, line.lengthCompare(column) > 0
, although not necessarily more readable :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I originally wrote lengthCompare
I overlooked that line
is Array
. So lengthCompare
is redundant optimization here :)
@kitbellew Also when running this changes on scala-repos I discovered idempotency violations on master: scala-repos diff: poslegm/scala-repos@4554a0a broken example:
(works correct at 2.4.2) Is it related to your latest changes? |
probably :( |
Fixes #1783
TL;DR