Don't nowrap() empty lines.
Summary:
f4d0dca introduced the nowrap control codes, but it was applying them before
the output was checked for empty(). That meant that empty lines weren't empty
anymore, and a lot of blank space got printed in e.g. `buck test --all`. Moving
the nowrap avoids this problem.
Test Plan: `buck test --all` no longer prints a lot of junk.
diff --git a/src/com/facebook/buck/event/listener/SuperConsoleEventBusListener.java b/src/com/facebook/buck/event/listener/SuperConsoleEventBusListener.java
index 414b3d2..350607f 100644
--- a/src/com/facebook/buck/event/listener/SuperConsoleEventBusListener.java
+++ b/src/com/facebook/buck/event/listener/SuperConsoleEventBusListener.java
@@ -97,7 +97,6 @@
synchronized void render() {
ImmutableList<String> lines = createRenderLinesAtTime(clock.currentTimeMillis());
String nextFrame = clearLastRender() + Joiner.on("\n").join(lines);
- nextFrame = ansi.asNoWrap(nextFrame);
lastNumLinesPrinted = lines.size();
// Synchronize on the DirtyPrintStreamDecorator to prevent interlacing of output.
@@ -108,6 +107,7 @@
if (console.getStdOut().isDirty() || console.getStdErr().isDirty()) {
renderScheduler.shutdown();
} else if (!nextFrame.isEmpty()) {
+ nextFrame = ansi.asNoWrap(nextFrame);
console.getStdErr().getRawStream().println(nextFrame);
}
}