1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

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

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
}