( ranges: readonly DocRange[], changes: ViewUpdate["changes"], )
| 187 | } |
| 188 | |
| 189 | function mapRanges( |
| 190 | ranges: readonly DocRange[], |
| 191 | changes: ViewUpdate["changes"], |
| 192 | ): DocRange[] { |
| 193 | return normalizeRanges( |
| 194 | ranges.map(({ from, to }) => ({ |
| 195 | from: changes.mapPos(from, -1), |
| 196 | to: changes.mapPos(to, 1), |
| 197 | })), |
| 198 | ); |
| 199 | } |
| 200 | |
| 201 | function expandRangeToLines(doc: Text, from: number, to: number): DocRange { |
| 202 | if (doc.length === 0) return { from: 0, to: 0 }; |
no test coverage detected