From 5605515fa1db7f84fae4a7088f0bf1dd95155514 Mon Sep 17 00:00:00 2001 From: Joachim LF Date: Fri, 5 Mar 2021 10:42:15 +0100 Subject: [PATCH] [Ion/clipboard] Remove CR when there's LF next --- ion/src/simulator/shared/clipboard.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ion/src/simulator/shared/clipboard.cpp b/ion/src/simulator/shared/clipboard.cpp index 896def716..9c3303691 100644 --- a/ion/src/simulator/shared/clipboard.cpp +++ b/ion/src/simulator/shared/clipboard.cpp @@ -25,6 +25,14 @@ const char * read() { return nullptr; } + char * cursor = &buffer[0]; + while(*cursor) { + if(*cursor == '\r' && *(cursor + 1) == '\n') { + memmove(cursor, cursor + 1, strlen(cursor)); + } + cursor++; + } + /* If version has not changed, the user has not copied any text since the * last call to write. A copy of the text already exists in * Escher::Clipboard, and has been translated to best suit the current app :