| 128 | } |
| 129 | |
| 130 | function splitIntoColumns( |
| 131 | types: string[], |
| 132 | tokens: string[] |
| 133 | ): [string[], string[]] { |
| 134 | const newTypes: string[] = []; |
| 135 | const newTokens: string[] = []; |
| 136 | tokens.forEach((token, i) => { |
| 137 | const tokenType = types[i]; |
| 138 | Array.from(token).forEach(char => { |
| 139 | newTokens.push(char); |
| 140 | newTypes.push(tokenType); |
| 141 | }); |
| 142 | }); |
| 143 | return [newTypes, newTokens]; |
| 144 | } |
| 145 | |
| 146 | function getDefaultFocus(prevLineKeys: number[], lineKeys: number[]) { |
| 147 | const focus = {} as Record<number, true>; |