()
| 287 | } |
| 288 | |
| 289 | private deleteWordForward(): void { |
| 290 | if (this.cursor >= this.value.length) return; |
| 291 | |
| 292 | // Save lastAction before cursor movement (moveWordForwards resets it) |
| 293 | const wasKill = this.lastAction === "kill"; |
| 294 | |
| 295 | this.pushUndo(); |
| 296 | |
| 297 | const oldCursor = this.cursor; |
| 298 | this.moveWordForwards(); |
| 299 | const deleteTo = this.cursor; |
| 300 | this.cursor = oldCursor; |
| 301 | |
| 302 | const deletedText = this.value.slice(this.cursor, deleteTo); |
| 303 | this.killRing.push(deletedText, { prepend: false, accumulate: wasKill }); |
| 304 | this.lastAction = "kill"; |
| 305 | |
| 306 | this.value = this.value.slice(0, this.cursor) + this.value.slice(deleteTo); |
| 307 | } |
| 308 | |
| 309 | private yank(): void { |
| 310 | const text = this.killRing.peek(); |
no test coverage detected