Complex sentence: Jean Valjean, who has witnessed the scene, leaves the inn, buys the expensive doll, and returns a moment and gives it to Cosette.
Split into simpler sentences: Jean Valjean, who has witnessed the scene, leaves the inn and buys the expensive doll. He returns a moment later and gives it to Cosette.