IDEA-66610 interpret carriage return (\r) in console only as carriage return and not as new line (\n)

Don't keep '\r' as is under Mac now
This commit is contained in:
Denis Zhdanov
2011-03-31 14:49:50 +04:00
parent 869733d272
commit b71d8bb16d
@@ -19,6 +19,7 @@ import com.google.common.collect.Lists;
import com.intellij.CommonBundle;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.TextRange;
import com.intellij.util.*;
import com.intellij.util.text.CharArrayCharSequence;
@@ -299,7 +300,7 @@ public class StringUtil {
}
else if (c == '\r') {
boolean followedByLineFeed = i < text.length() - 1 && text.charAt(i + 1) == '\n';
if (!followedByLineFeed && keepCarriageReturn) {
if (!followedByLineFeed && keepCarriageReturn && !SystemInfo.isMac) {
if (buffer == null) {
intactLength++;
}