DBE-2463 Can't view multiline errors: suppress terminal \r emulation

This commit is contained in:
Gregory.Shrago
2016-03-17 02:18:58 +03:00
parent af5ba8b54b
commit f1df42e176
2 changed files with 11 additions and 1 deletions
@@ -110,6 +110,8 @@ public class ConsoleBuffer {
private final List<TokenInfo> myDeferredTokens = new ArrayList<TokenInfo>();
private final Set<ConsoleViewContentType> myDeferredTypes = new HashSet<ConsoleViewContentType>();
private boolean myKeepSlashR = true;
public ConsoleBuffer() {
this(useCycleBuffer(), getCycleBufferSize(), DEFAULT_CYCLIC_BUFFER_UNIT_SIZE);
}
@@ -144,6 +146,10 @@ public class ConsoleBuffer {
return myCyclicBufferSize;
}
void setKeepSlashR(boolean keep) {
myKeepSlashR = keep;
}
public boolean isEmpty() {
return myDeferredOutput.isEmpty() || (myDeferredOutput.size() == 1 && myDeferredOutput.getFirst().length() <= 0);
}
@@ -286,7 +292,7 @@ public class ConsoleBuffer {
myDeferredTypes.add(contentType);
s = StringUtil.convertLineSeparators(s, true);
s = StringUtil.convertLineSeparators(s, myKeepSlashR);
myDeferredOutputLength += s.length();
StringBuilder bufferToUse;
@@ -454,6 +454,10 @@ public class ConsoleViewImpl extends JPanel implements ConsoleView, ObservableCo
return myOutputPaused;
}
public void setEmulateCarriageReturn(boolean emulate) {
myBuffer.setKeepSlashR(emulate);
}
@Override
public boolean hasDeferredOutput() {
synchronized (LOCK) {