Further fixes to TextEditor.replaceContents(): internal/external clients have different needs

TBR @devoncarew. Existing usage isn't effectively affected (the change is for future usage).