Swapping selection side keeps cursor in view.

The code would not change the viewport when swapping sides, and it also
wouldn't scroll.

MotionCommand has some code implemented for this, reuse it to implement
centering if the selection spans more than a few screen-fulls.