function transformAndRemoveOverflowing(tokens, fauxIndentLength, len) {
        var result = [], resultLen = 0;
        // The faux indent part of the line should have no token type
        if (fauxIndentLength > 0) {
            result[resultLen++] = new LinePart(fauxIndentLength, '');
        }
        for (var tokenIndex = 0, tokensLen = tokens.length; tokenIndex < tokensLen; tokenIndex++) {
            var token = tokens[tokenIndex];
            var endIndex = token.endIndex;
            if (endIndex <= fauxIndentLength) {
                // The faux indent part of the line should have no token type
                continue;
            }
            var type = token.getType();
            if (endIndex >= len) {
                result[resultLen++] = new LinePart(len, type);
                break;
            }
            result[resultLen++] = new LinePart(endIndex, type);
        }
        return result;
    }
In the rendering phase, characters are always looped until token.endIndex.
Ensure that all tokens end before `len` and the last one ends precisely at `len`.