From 50569ccd4f6e2294abded1a229814c68c2b1595d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Sat, 22 Apr 2017 16:01:53 +0200 Subject: Erase all carriage return characters from TextEdit texts. This should fix the "weird newlines" bug. --- plugingui/textedit.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugingui/textedit.cc b/plugingui/textedit.cc index aee8e13..b7603a1 100644 --- a/plugingui/textedit.cc +++ b/plugingui/textedit.cc @@ -99,6 +99,17 @@ void TextEdit::preprocessText() } } + { // Handle "\r" + for(size_t i = 0; i < text.length(); ++i) + { + char ch = text.at(i); + if(ch == '\r') + { + text.erase(i, 1); + } + } + } + std::list lines; { // Handle new line characters size_t pos = 0; -- cgit v1.2.3