mapLineOffsets now returns total number of lines