(end: Cursor, insertString: string = '')
| 818 | } |
| 819 | |
| 820 | modifyText(end: Cursor, insertString: string = ''): Cursor { |
| 821 | const startOffset = this.offset |
| 822 | const endOffset = end.offset |
| 823 | |
| 824 | const newText = |
| 825 | this.text.slice(0, startOffset) + |
| 826 | insertString + |
| 827 | this.text.slice(endOffset) |
| 828 | |
| 829 | return Cursor.fromText( |
| 830 | newText, |
| 831 | this.columns, |
| 832 | startOffset + insertString.normalize('NFC').length, |
| 833 | ) |
| 834 | } |
| 835 | |
| 836 | insert(insertString: string): Cursor { |
| 837 | const newCursor = this.modifyText(this, insertString) |
no test coverage detected