Its probably the same as this:
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/11482From memory...
When the caret moves the editor checks if the scroll-pos is correct / ideal.
E.g. if you move the caret off screen, then scrolling follows
But part of that is also to have the selection horizontally in the visible field.
E.g. if you have a very long line, you start at pos 20 and select towards the right. The pos 20 scrolls out to the left. But if you then "deselect leftwards" (shift cursor left) then the pos 20 is scrolled back into view. Even so the caret is on the right side of the editor, and the caret does not force that scroll.
But in other scenarios that is less desirable...
Based on non-persistent selections I hadn't yet decided if to do any change at all... It's rare, and in some cases desired.
With a persistent block that is more of an issue.
You may want to add your case to the existing issue.
Still need to come up with a good solution....
For the persistent issue, it might be a start, to check "selection bounds" only, if the caret is at an selection bound (if it is, check both bounds).
That would make it more similar to what happens for non persistent selections.