()
| 222 | } |
| 223 | |
| 224 | private handleBackspace(): void { |
| 225 | this.lastAction = null; |
| 226 | if (this.cursor > 0) { |
| 227 | this.pushUndo(); |
| 228 | const beforeCursor = this.value.slice(0, this.cursor); |
| 229 | const graphemes = [...segmenter.segment(beforeCursor)]; |
| 230 | const lastGrapheme = graphemes[graphemes.length - 1]; |
| 231 | const graphemeLength = lastGrapheme ? lastGrapheme.segment.length : 1; |
| 232 | this.value = this.value.slice(0, this.cursor - graphemeLength) + this.value.slice(this.cursor); |
| 233 | this.cursor -= graphemeLength; |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | private handleForwardDelete(): void { |
| 238 | this.lastAction = null; |
no test coverage detected