Pass snapshot around to be robust against text changes