Further fix replacing contents in TextEditor: internal/external clients have different needs