I'm implementing a text editor with RichEdit coupled with the text
object model. I use the GetText method under ITextRange to retrieve
the text and process it.
If I type in a single line in the control, GetText returns the text as
expected.
What puzzles me is the behavior when I type in a line break. Let's
say I hit 'a' followed by 'return' followed by 'a'. GetText returns
four characters:
'a', CR, 'a', CR
Where did that last CR come from? Under what circumstances can I
always expect RichEdit to append the extra CR? Is this consistent
across all versions? I'd like to trim off that CR before processing
the text; to do that I'd have to be sure that the user didn't input it
himself.
On a tangent, I think I've read somewhere that RichEdit used to use
LF/CR for linebreaks...at what version did that change to CR alone?