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

Method insertCharacter

packages/pi-tui/src/components/input.ts:213–222  ·  view source on GitHub ↗
(char: string)

Source from the content-addressed store, hash-verified

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;

Callers 1

handleInputMethod · 0.95

Calls 2

pushUndoMethod · 0.95
isWhitespaceCharFunction · 0.90

Tested by

no test coverage detected