Hello,
Thanks for the sample. The problem here is that you want the SyntaxEditor.CanScrollPastDocumentEnd property to be false, which it is by default. However you have word wrap on here and per the remarks for that property: "This property has no effect when word wrap mode is active."
The reason is a bit complex. Basically all our view lines are virtualized so we don't know the "layout" of lines that aren't currently visible in the editor. While CanScrollPastDocumentEnd = false, and when calculating the maximum scrollbar value for non-wordwrap mode, we can say it is the last line minus the visible line count. That ensures that you can't scroll past the visible lines. However when in word wrap mode, we have to adjust the scrollbar based on the percentage of offsets through the document length. Since we don't have the entire document line layouts stored, we don't consistently know how many offsets near the end of the document to subtract to ensure that you can't scroll past the end of the document. That's why the property has no effect when word wrap mode is on, such as in your situation.
I would recommend perhaps disabling mouse wheel scrolling by handling preview mouse wheel events. That will help with the mouse wheel portion. As long as the editor is large enough, I'm not seeing the the caret at the end scrolling. How do you repro that?