mirror of https://github.com/noisymime/Arduino.git
ConsoleOutputStream: replacing \r to \n when printing on IDE console
This commit is contained in:
parent
e15ba64ee2
commit
98874e4af2
|
@ -116,8 +116,9 @@ public class ConsoleOutputStream extends ByteArrayOutputStream {
|
||||||
if (document != null) {
|
if (document != null) {
|
||||||
SwingUtilities.invokeLater(() -> {
|
SwingUtilities.invokeLater(() -> {
|
||||||
try {
|
try {
|
||||||
|
String lineWithoutSlashR = line.replace("\r\n", "\n").replace("\r", "\n");
|
||||||
int offset = document.getLength();
|
int offset = document.getLength();
|
||||||
document.insertString(offset, line, attributes);
|
document.insertString(offset, lineWithoutSlashR, attributes);
|
||||||
} catch (BadLocationException ble) {
|
} catch (BadLocationException ble) {
|
||||||
//ignore
|
//ignore
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue