MCPcopy
hub / github.com/chenglou/pretext / createLayoutLine

Function createLayoutLine

src/layout.ts:713–741  ·  view source on GitHub ↗
(
  prepared: PreparedTextWithSegments,
  cache: Map<number, string[]>,
  width: number,
  startSegmentIndex: number,
  startGraphemeIndex: number,
  endSegmentIndex: number,
  endGraphemeIndex: number,
)

Source from the content-addressed store, hash-verified

711}
712
713function createLayoutLine(
714 prepared: PreparedTextWithSegments,
715 cache: Map<number, string[]>,
716 width: number,
717 startSegmentIndex: number,
718 startGraphemeIndex: number,
719 endSegmentIndex: number,
720 endGraphemeIndex: number,
721): LayoutLine {
722 return {
723 text: buildLineTextFromRange(
724 prepared,
725 cache,
726 startSegmentIndex,
727 startGraphemeIndex,
728 endSegmentIndex,
729 endGraphemeIndex,
730 ),
731 width,
732 start: {
733 segmentIndex: startSegmentIndex,
734 graphemeIndex: startGraphemeIndex,
735 },
736 end: {
737 segmentIndex: endSegmentIndex,
738 graphemeIndex: endGraphemeIndex,
739 },
740 }
741}
742
743function createLayoutLineRange(
744 width: number,

Callers 3

materializeLineRangeFunction · 0.85
layoutNextLineFunction · 0.85
layoutWithLinesFunction · 0.85

Calls 1

buildLineTextFromRangeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…