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);