ConsoleOutputStream: replacing \r to \n when printing on IDE console

This commit is contained in:
Federico Fissore 2015-06-29 15:04:30 +02:00
parent e15ba64ee2
commit 98874e4af2
1 changed files with 2 additions and 1 deletions

View File

@ -116,8 +116,9 @@ public class ConsoleOutputStream extends ByteArrayOutputStream {
if (document != null) {
SwingUtilities.invokeLater(() -> {
try {
String lineWithoutSlashR = line.replace("\r\n", "\n").replace("\r", "\n");
int offset = document.getLength();
document.insertString(offset, line, attributes);
document.insertString(offset, lineWithoutSlashR, attributes);
} catch (BadLocationException ble) {
//ignore
}