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

Method undo

packages/pi-tui/src/components/editor.ts:2082–2092  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2080 }
2081
2082 private undo(): void {
2083 this.exitHistoryBrowsing();
2084 const snapshot = this.undoStack.pop();
2085 if (!snapshot) return;
2086 Object.assign(this.state, snapshot);
2087 this.lastAction = null;
2088 this.preferredVisualCol = null;
2089 if (this.onChange) {
2090 this.onChange(this.getText());
2091 }
2092 }
2093
2094 /**
2095 * Jump to the first occurrence of a character in the specified direction.

Callers 1

handleInputMethod · 0.95

Calls 3

exitHistoryBrowsingMethod · 0.95
getTextMethod · 0.95
popMethod · 0.80

Tested by

no test coverage detected