When I set Window backgroundColor = .clear, disable NSTextView draw background, then I change NSTextView.string as you can see in the picture, preview text retain in the background.
POC code is here SingleView
How can I clear the background text (Foo1245 in the image background) when change NSTextView.string ?