(startLine, deleteCount, newLineEntries)
| 1697 | // Change the abstract representation of the document to have a different set of lines. |
| 1698 | // Must be called after rep.alltext is set. |
| 1699 | const doRepLineSplice = (startLine, deleteCount, newLineEntries) => { |
| 1700 | for (const entry of newLineEntries) entry.width = entry.text.length + 1; |
| 1701 | |
| 1702 | const startOldChar = rep.lines.offsetOfIndex(startLine); |
| 1703 | const endOldChar = rep.lines.offsetOfIndex(startLine + deleteCount); |
| 1704 | |
| 1705 | rep.lines.splice(startLine, deleteCount, newLineEntries); |
| 1706 | currentCallStack.docTextChanged = true; |
| 1707 | currentCallStack.repChanged = true; |
| 1708 | const newText = newLineEntries.map((e) => `${e.text}\n`).join(''); |
| 1709 | |
| 1710 | rep.alltext = rep.alltext.substring(0, startOldChar) + |
| 1711 | newText + rep.alltext.substring(endOldChar, rep.alltext.length); |
| 1712 | }; |
| 1713 | |
| 1714 | const doIncorpLineSplice = (startLine, deleteCount, newLineEntries, lineAttribs, hints) => { |
| 1715 | const startOldChar = rep.lines.offsetOfIndex(startLine); |
no test coverage detected