(chunk, index)
| 684 | } |
| 685 | } |
| 686 | _splitChunk(chunk, index) { |
| 687 | if (chunk.edited && chunk.content.length) { |
| 688 | const loc = getLocator(this.original)(index); |
| 689 | throw new Error( |
| 690 | `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} \u2013 "${chunk.original}")`, |
| 691 | ); |
| 692 | } |
| 693 | const newChunk = chunk.split(index); |
| 694 | this.byEnd[index] = chunk; |
| 695 | this.byStart[index] = newChunk; |
| 696 | this.byEnd[newChunk.end] = newChunk; |
| 697 | if (chunk === this.lastChunk) this.lastChunk = newChunk; |
| 698 | this.lastSearchedChunk = chunk; |
| 699 | return true; |
| 700 | } |
| 701 | toString() { |
| 702 | let str = this.intro; |
| 703 | let chunk = this.firstChunk; |
no test coverage detected