It's not unusual for a NSTextView to place the insertion point (selectedRange) at the end of the document when you set its string to a new value. Usually, it doesn't scroll down there, though. Depending on the use case, this might not be desirable.
I figure this is due to the fixInsertionPointPosition() call which is there to do just that: re-set the selectedRange to make the view scroll and/or forceLayoutWithNewInsets().
It's not unusual for a NSTextView to place the insertion point (
selectedRange) at the end of the document when you set itsstringto a new value. Usually, it doesn't scroll down there, though. Depending on the use case, this might not be desirable.I figure this is due to the
fixInsertionPointPosition()call which is there to do just that: re-set theselectedRangeto make the view scroll and/orforceLayoutWithNewInsets().