MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / segment

Method segment

src/utils/textHighlighting.ts:77–95  ·  view source on GitHub ↗
(highlights: TextHighlight[])

Source from the content-addressed store, hash-verified

75 }
76
77 segment(highlights: TextHighlight[]): TextSegment[] {
78 const segments: TextSegment[] = []
79
80 for (const highlight of highlights) {
81 const before = this.segmentTo(highlight.start)
82 if (before) segments.push(before)
83
84 const highlighted = this.segmentTo(highlight.end)
85 if (highlighted) {
86 highlighted.highlight = highlight
87 segments.push(highlighted)
88 }
89 }
90
91 const after = this.segmentTo(Infinity)
92 if (after) segments.push(after)
93
94 return segments
95 }
96
97 private segmentTo(targetVisiblePos: number): TextSegment | null {
98 if (

Callers 15

flushBufferFunction · 0.80
stringWidthJavaScriptFunction · 0.80
firstGraphemeFunction · 0.80
lastGraphemeFunction · 0.80
segmentGraphemesFunction · 0.80
segmentGraphemesFunction · 0.80
GlimmerMessageFunction · 0.80
renderMethod · 0.80
getGraphemeBoundariesMethod · 0.80
getWordBoundariesMethod · 0.80
truncateToWidthFunction · 0.80

Calls 2

segmentToMethod · 0.95
pushMethod · 0.45

Tested by

no test coverage detected