Don't change position of caret for textoperations.

TextOperationCommand tends to reset the selection already, making the
-1/+1 trick run into a one-off situation.

Only move the pointer if we're actually executing LeaveVisualCommand,
as the doIt method is used in places where the selection is alreadly
cleared.
Fix test: caret no longer ends up past line.

The test supposed that the caret was right before a newline, but a
previous fix now moves the caret back to the previous character on the
line.