()
| 889 | } |
| 890 | |
| 891 | deleteWordBefore(): { cursor: Cursor; killed: string } { |
| 892 | if (this.isAtStart()) { |
| 893 | return { cursor: this, killed: '' } |
| 894 | } |
| 895 | const target = this.snapOutOfImageRef(this.prevWord().offset, 'start') |
| 896 | const prevWordCursor = new Cursor(this.measuredText, target) |
| 897 | const killed = this.text.slice(prevWordCursor.offset, this.offset) |
| 898 | return { cursor: prevWordCursor.modifyText(this), killed } |
| 899 | } |
| 900 | |
| 901 | /** |
| 902 | * Deletes a token before the cursor if one exists. |
no test coverage detected