![Avatar](https://secure.gravatar.com/avatar/1dfca13b83e14639a53baba8836a026b.jpg?s=64&d=identicon&r=g)
I'm appending text, but before I do, I want to make sure that the document ends with a new line. This code works:
I'm wondering if that's the 'best' way to do it. Is accessing Document.Lines expensive?
int lineCount = editor.Document.Lines.Count;
return (lineCount == 0 || editor.Document.Lines[lineCount - 1].Length == 0);