-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix diff text lines missing #95
Conversation
The `\n` was added only if the first condition was false because of if/else priorities.
We probably should add tests to avoid future regressions. |
} | ||
|
||
val diffTextWithPlusAndMinusWithColor: String = diffTextWithPlusAndMinus.lines().joinToString(separator = "") { | ||
if (it.startsWith("-")) { | ||
ColorTerminal.colorify(ColorTerminal.ANSI_RED, it) | ||
val line = if (it.startsWith("-")) { |
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.
Would a stringBuilder
be good here? You could use .append()
and .appendLine()
instead of the \n
char?
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.
Yes, it will work as well. I would prefer using the same methods on both colored and non-colored outputs. I'll try to come up with something better.
| "We probably should add tests to avoid future regressions." What isn't covered? I think because we're on -- Thank you for the PR! |
The current tests were asserting on the Gradle exception message. |
The new version now uses StringBuilder, which makes new lines automatically handled. |
Sounds good. Is this ready to merge? Looked fine. |
Yup, ready to be merged 👌 |
The
\n
was added only if the first condition was false because of if/else priorities.is in fact executed as
Closing #94