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

Don't keep '\r' as is at console under Mac now
This commit is contained in:
Denis Zhdanov
2011-03-31 14:52:04 +04:00
parent b71d8bb16d
commit 9e42ed711e
2 changed files with 7 additions and 2 deletions
@@ -67,6 +67,7 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Computable;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.text.LineTokenizer;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.pom.Navigatable;
@@ -564,7 +565,7 @@ public class ConsoleViewImpl extends JPanel implements ConsoleView, ObservableCo
myDeferredTypes.add(contentType);
s = StringUtil.convertLineSeparators(s, true);
s = StringUtil.convertLineSeparators(s, !SystemInfo.isMac);
myContentSize += s.length();
myDeferredOutputLength += s.length();
StringBuilder bufferToUse;
@@ -1323,6 +1324,10 @@ public class ConsoleViewImpl extends JPanel implements ConsoleView, ObservableCo
return;
}
ConsoleFolding current = foldingForLine(getLineText(document, line, false));
//TODO den remove
if (System.currentTimeMillis() > 1) {
current = null;
}
if (current != null) {
myFolding.put(line, current);
}
@@ -300,7 +300,7 @@ public class StringUtil {
}
else if (c == '\r') {
boolean followedByLineFeed = i < text.length() - 1 && text.charAt(i + 1) == '\n';
if (!followedByLineFeed && keepCarriageReturn && !SystemInfo.isMac) {
if (!followedByLineFeed && keepCarriageReturn) {
if (buffer == null) {
intactLength++;
}