compute the source on the right using edits and ranges