When a text string is longer than the available space it can be at a scrolled offset, so that you can edit text that is wider than its container. When selected text is deleted we don't update this offset, so it is possible to have newly pasted text scrolled out of view. This PR decreases the offset by the amount of the selected string that is currently out of view. Pull Request: https://projects.blender.org/blender/blender/pulls/134815