(end: Cursor, insertString: string = '')
| 843 | } |
| 844 | |
| 845 | modifyText(end: Cursor, insertString: string = ''): Cursor { |
| 846 | const startOffset = this.offset |
| 847 | const endOffset = end.offset |
| 848 | |
| 849 | const newText = |
| 850 | this.text.slice(0, startOffset) + |
| 851 | insertString + |
| 852 | this.text.slice(endOffset) |
| 853 | |
| 854 | return Cursor.fromText( |
| 855 | newText, |
| 856 | this.columns, |
| 857 | startOffset + insertString.normalize('NFC').length, |
| 858 | ) |
| 859 | } |
| 860 | |
| 861 | insert(insertString: string): Cursor { |
| 862 | const newCursor = this.modifyText(this, insertString) |
no test coverage detected