Sync scrolling of two text fields

is there any possibilty to synchronise the scrolling of two text fields?

e.g. two show line numbering to the user


I don’t see a way to achieve this with text areas, but as I understand the use case, it could be better anyway to use grids. If you use these with server side scrolling, you will receive the scroll events in the application and can use them to keep both grids in sync.
Best regards, Thomas