summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2017-04-22 16:01:53 +0200
committerAndré Nusser <andre.nusser@googlemail.com>2017-04-22 16:01:53 +0200
commit50569ccd4f6e2294abded1a229814c68c2b1595d (patch)
treed3454a8fbd87504ba1344aedd725cba6ab106346
parentb08f2dc51eab76780a9e38a7e82ec322d86e8d19 (diff)
Erase all carriage return characters from TextEdit texts.
This should fix the "weird newlines" bug.
-rw-r--r--plugingui/textedit.cc11
1 files changed, 11 insertions, 0 deletions
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<std::string> lines;
{ // Handle new line characters
size_t pos = 0;