When creating a source, we iterate once to calculate line offsets and then iterate a second time to create the underlying buffer. This change moves the logic to calculate line offsets into the buffer creation. This avoids iterating the source twice and counting code points.
When creating a source, we iterate once to calculate line offsets and then iterate a second time to create the underlying buffer. This change moves the logic to calculate line offsets into the buffer creation. This avoids iterating the source twice and counting code points.