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

Method segment

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

Segment text with paste-marker awareness, only merging markers with valid IDs.

(text: string, mode: "word" | "grapheme")

Source from the content-addressed store, hash-verified

377
378 /** Segment text with paste-marker awareness, only merging markers with valid IDs. */
379 private segment(text: string, mode: "word" | "grapheme"): Iterable<Intl.SegmentData> {
380 return segmentWithMarkers(text, mode === "word" ? wordSegmenter : graphemeSegmenter, this.validPasteIds());
381 }
382
383 getPaddingX(): number {
384 return this.paddingX;

Callers 15

renderMethod · 0.95
layoutTextMethod · 0.95
handleBackspaceMethod · 0.95
moveToVisualLineMethod · 0.95
handleForwardDeleteMethod · 0.95
buildVisualLineMapMethod · 0.95
moveCursorMethod · 0.95
moveWordBackwardsMethod · 0.95
moveWordForwardsMethod · 0.95
truncateFragmentToWidthFunction · 0.45
visibleWidthFunction · 0.45
splitIntoTokensWithAnsiFunction · 0.45

Calls 2

validPasteIdsMethod · 0.95
segmentWithMarkersFunction · 0.85

Tested by

no test coverage detected