The it seems, that HIViewScrollRect does not deal with already invalidated areas.
SynEdit first invalidates the current line (if there is highlight on the current line *AND* the current line changes), and then scrolls.
This may mean there may be other artefacts (like the red border for begin/end pairs).
You can add an
InvalidateLines(1,1) // first line on screen
OR
InvalidateLines(LinesInWindow, LinesInWindow+1) // last line on screen
in the
if ScrollWindowEx(Handle, 0, LineHeight * Delta, @srect, @srect, 0, nil, SW_INVALIDATE)
then begin
depending on delta being positive or negative.
If you add them unconditional, you will have a full screen invalidate.....
---------------
Yes it needs a proper fix.
But I am a bit short on time now.