What's more, copying and pasting text with whitespace before it, creates additional whitespace before and after it.
I'm not sure if it's related to the new line issue above - but it's similar enough I figured I'd post it here rather than start a new bug report (please split to new bug report if it is unrelated)
My snagit video capture isn't working, so I'll try and explain in screenshots.
1. start with a single word at the start of the line with no whitespace before or after:
2. copy the text and then paste it immediately after without inserting any whitespace - you get the expected result:
3. do the same thing, single word at the start of the line, but this time, don't copy the whole word, only copy one of the letters (any amount less than the full word)
4. paste it at the end of the word without inserting whitespace and the editor will automagically insert whitespace before and after the pasted text
5. now do the same thing again with a word at the beginning of the line, but put whitespace after the text before copying only the text (but not the whitespace).
6. paste the text immediately after the text but before the whitespace - the pasted text has whitespace automagically inserted before it and after it:
You would expect "foofoo bar", but instead you get "foo foo bar" with whitespace inserted both before and after the pasted foo and so there is now two spaces between the 2nd foo and the bar:
It seems as though the editor will do the right thing if you copy an entire line up to the line ending, but anything which doesn't include a line ending, will cause the editor to insert whitespace both before and after the text.
I also note that if you paste anything that doesn't include a line ending onto a new line, it will only insert whitespace at the end of the pasted text, not at the beginning.