The main problem is, that Apple seems to have changed how rulers affect the scroll position.
Our line numbers are a ruler in the scroll view. In the past, NSScrollView would automatically inset the content so the ruler does not overlap the content. This has changed but it is unclear when.
Anyway, I did the following:
Made TextViewController adjust the width of the text view to take the width of the number ivew into account (subtract it)
Made all scrolling not scroll to (0,y) but to (lineNumberWidth, y)
The main problem is, that Apple seems to have changed how rulers affect the scroll position. Our line numbers are a ruler in the scroll view. In the past, NSScrollView would automatically inset the content so the ruler does not overlap the content. This has changed but it is unclear when. Anyway, I did the following: