()
| 266 | } |
| 267 | |
| 268 | private deleteWordBackwards(): void { |
| 269 | if (this.cursor === 0) return; |
| 270 | |
| 271 | // Save lastAction before cursor movement (moveWordBackwards resets it) |
| 272 | const wasKill = this.lastAction === "kill"; |
| 273 | |
| 274 | this.pushUndo(); |
| 275 | |
| 276 | const oldCursor = this.cursor; |
| 277 | this.moveWordBackwards(); |
| 278 | const deleteFrom = this.cursor; |
| 279 | this.cursor = oldCursor; |
| 280 | |
| 281 | const deletedText = this.value.slice(deleteFrom, this.cursor); |
| 282 | this.killRing.push(deletedText, { prepend: true, accumulate: wasKill }); |
| 283 | this.lastAction = "kill"; |
| 284 | |
| 285 | this.value = this.value.slice(0, deleteFrom) + this.value.slice(this.cursor); |
| 286 | this.cursor = deleteFrom; |
| 287 | } |
| 288 | |
| 289 | private deleteWordForward(): void { |
| 290 | if (this.cursor >= this.value.length) return; |
no test coverage detected