diff --git a/platform/lang-impl/src/com/intellij/execution/impl/ConsoleBuffer.java b/platform/lang-impl/src/com/intellij/execution/impl/ConsoleBuffer.java index 8ad45fc099cc..ecd32dc726e0 100644 --- a/platform/lang-impl/src/com/intellij/execution/impl/ConsoleBuffer.java +++ b/platform/lang-impl/src/com/intellij/execution/impl/ConsoleBuffer.java @@ -110,6 +110,8 @@ public class ConsoleBuffer { private final List myDeferredTokens = new ArrayList(); private final Set myDeferredTypes = new HashSet(); + 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; diff --git a/platform/lang-impl/src/com/intellij/execution/impl/ConsoleViewImpl.java b/platform/lang-impl/src/com/intellij/execution/impl/ConsoleViewImpl.java index 26c721d2484f..5f0b6a10bc50 100644 --- a/platform/lang-impl/src/com/intellij/execution/impl/ConsoleViewImpl.java +++ b/platform/lang-impl/src/com/intellij/execution/impl/ConsoleViewImpl.java @@ -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) {