| 360 | } |
| 361 | |
| 362 | private handlePaste(pastedText: string): void { |
| 363 | this.lastAction = null; |
| 364 | this.pushUndo(); |
| 365 | |
| 366 | // Clean the pasted text - remove newlines and carriage returns |
| 367 | const cleanText = pastedText.replace(/\r\n/g, "").replace(/\r/g, "").replace(/\n/g, "").replace(/\t/g, " "); |
| 368 | |
| 369 | // Insert at cursor position |
| 370 | this.value = this.value.slice(0, this.cursor) + cleanText + this.value.slice(this.cursor); |
| 371 | this.cursor += cleanText.length; |
| 372 | } |
| 373 | |
| 374 | invalidate(): void { |
| 375 | // No cached state to invalidate currently |