TextArea - How to modify visible lines only?

I do some simple syntax highlighting in my TextArea. But instead of updating the complete text every time on TextChange event I just want to update the visible lines. How to get/modify only the visible lines?

If you just want to keep track of the highlighted text in the TextArea, you can use .SelChanged event… If you need to track what’s actually visible in the TextArea, I’m thinking some math would be needed, if it is at all doable…

		firstChar= Me.charPosatXY(0,0)-1
		lastChar = Me.CharPosAtXY(Me.width,Me.height)