diff options
| author | André Nusser <andre.nusser@googlemail.com> | 2017-04-22 16:01:53 +0200 | 
|---|---|---|
| committer | André Nusser <andre.nusser@googlemail.com> | 2017-04-22 16:01:53 +0200 | 
| commit | 50569ccd4f6e2294abded1a229814c68c2b1595d (patch) | |
| tree | d3454a8fbd87504ba1344aedd725cba6ab106346 /plugingui | |
| parent | b08f2dc51eab76780a9e38a7e82ec322d86e8d19 (diff) | |
Erase all carriage return characters from TextEdit texts.
This should fix the "weird newlines" bug.
Diffstat (limited to 'plugingui')
| -rw-r--r-- | plugingui/textedit.cc | 11 | 
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;  | 
