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

Method handleForwardDelete

packages/pi-tui/src/components/input.ts:237–247  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

235 }
236
237 private handleForwardDelete(): void {
238 this.lastAction = null;
239 if (this.cursor < this.value.length) {
240 this.pushUndo();
241 const afterCursor = this.value.slice(this.cursor);
242 const graphemes = [...segmenter.segment(afterCursor)];
243 const firstGrapheme = graphemes[0];
244 const graphemeLength = firstGrapheme ? firstGrapheme.segment.length : 1;
245 this.value = this.value.slice(0, this.cursor) + this.value.slice(this.cursor + graphemeLength);
246 }
247 }
248
249 private deleteToLineStart(): void {
250 if (this.cursor === 0) return;

Callers 1

handleInputMethod · 0.95

Calls 2

pushUndoMethod · 0.95
segmentMethod · 0.45

Tested by

no test coverage detected