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

Method insertTextAtCursor

packages/pi-tui/src/components/editor.ts:1123–1130  ·  view source on GitHub ↗

* Insert text at the current cursor position. * Used for programmatic insertion (e.g., clipboard image markers). * This is atomic for undo - single undo restores entire pre-insert state.

(text: string)

Source from the content-addressed store, hash-verified

1121 * This is atomic for undo - single undo restores entire pre-insert state.
1122 */
1123 insertTextAtCursor(text: string): void {
1124 if (!text) return;
1125 this.cancelAutocomplete();
1126 this.pushUndoSnapshot();
1127 this.lastAction = null;
1128 this.exitHistoryBrowsing();
1129 this.insertTextAtCursorInternal(text);
1130 }
1131
1132 /**
1133 * Normalize text for editor storage:

Callers

nothing calls this directly

Calls 4

cancelAutocompleteMethod · 0.95
pushUndoSnapshotMethod · 0.95
exitHistoryBrowsingMethod · 0.95

Tested by

no test coverage detected