def METHOD_NAME() -> Iterator[Mark]:
    row, _ = pos
    len8 = tuple(accumulate(len(encode(line)) + _NL for line in new_lines))
    for r_idx, region in regions:
        r1, c1, r2, c2 = None, None, None, None
        last_len = 0
        for idx, l8 in enumerate(len8):
            x_shift = 0 if idx else len(encode(l0_before))
            if r1 is None:
                if l8 > region.begin:
                    r1, c1 = idx + row, region.begin - last_len + x_shift
                elif l8 == region.begin:
                    r1, c1 = idx + row + 1, x_shift
            if r2 is None:
                if l8 > region.end:
                    r2, c2 = idx + row, region.end - last_len + x_shift
                elif l8 == region.end:
                    r2, c2 = idx + row + 1, x_shift
            if r1 is not None and r2 is not None:
                break
            last_len = l8
        assert (r1 is not None and c1 is not None) and (
            r2 is not None and c2 is not None
        ), pformat((region, new_lines))
        begin, end = (r1, c1), (r2, c2)
        mark = Mark(idx=r_idx, begin=begin, end=end, text=region.text)
        yield mark