(char: string)
| 211 | } |
| 212 | |
| 213 | private insertCharacter(char: string): void { |
| 214 | // Undo coalescing: consecutive word chars coalesce into one undo unit |
| 215 | if (isWhitespaceChar(char) || this.lastAction !== "type-word") { |
| 216 | this.pushUndo(); |
| 217 | } |
| 218 | this.lastAction = "type-word"; |
| 219 | |
| 220 | this.value = this.value.slice(0, this.cursor) + char + this.value.slice(this.cursor); |
| 221 | this.cursor += char.length; |
| 222 | } |
| 223 | |
| 224 | private handleBackspace(): void { |
| 225 | this.lastAction = null; |
no test coverage detected