restore typing attributes following a newline
restore typing attributes following a newline

Setting the selectedTextRange after the insertion wipes the override text attributes. This would cause the text in the next line to take on the typing attributes of the line instead. But we want to be able to continue typing with the same attributes.

This fix restores the typing attributes if the replacement text has a \n suffix and if the selectedTextRange after the insertion isEmpty (i.e. has zero length)

Fixes #4

Cocoanetics/DTRichTextEditor,liulinjian/DTRichTextEditor,programming086/DTRichTextEditor,fishermenlabs/DTRichTextEditor,fishermenlabs/DTRichTextEditor,programming086/DTRichTextEditor,liulinjian/DTRichTextEditor