()
| 914 | } |
| 915 | |
| 916 | deleteWordBefore(): { cursor: Cursor; killed: string } { |
| 917 | if (this.isAtStart()) { |
| 918 | return { cursor: this, killed: '' } |
| 919 | } |
| 920 | const target = this.snapOutOfImageRef(this.prevWord().offset, 'start') |
| 921 | const prevWordCursor = new Cursor(this.measuredText, target) |
| 922 | const killed = this.text.slice(prevWordCursor.offset, this.offset) |
| 923 | return { cursor: prevWordCursor.modifyText(this), killed } |
| 924 | } |
| 925 | |
| 926 | /** |
| 927 | * Deletes a token before the cursor if one exists. |
no test coverage detected