Fix walking caret bug

white-space css prop must be set to pre-wrap to keep trailing spaces
fixes #1766
Merge pull request #2004 from ether/fix/walking-caret

Fix walking caret bug