Skip to content

Commit 98874e4

Browse files
author
Federico Fissore
committed
ConsoleOutputStream: replacing \r to \n when printing on IDE console
1 parent e15ba64 commit 98874e4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/src/cc/arduino/ConsoleOutputStream.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,9 @@ private void clearBuffer() {
116116
if (document != null) {
117117
SwingUtilities.invokeLater(() -> {
118118
try {
119+
String lineWithoutSlashR = line.replace("\r\n", "\n").replace("\r", "\n");
119120
int offset = document.getLength();
120-
document.insertString(offset, line, attributes);
121+
document.insertString(offset, lineWithoutSlashR, attributes);
121122
} catch (BadLocationException ble) {
122123
//ignore
123124
}

0 commit comments

Comments
 (0)