Merge duplicating code to move cursor left/right.