MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / handlePaste

Method handlePaste

packages/pi-tui/src/components/input.ts:362–372  ·  view source on GitHub ↗
(pastedText: string)

Source from the content-addressed store, hash-verified

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

Callers 1

handleInputMethod · 0.95

Calls 1

pushUndoMethod · 0.95

Tested by

no test coverage detected