move cursor to valid position when current is invalid (on call invalidate)