MCPcopy Create free account
hub / github.com/Noumena-Network/code / makeStyledLineFrame

Function makeStyledLineFrame

src/ink/logUpdateFlickerRegression.test.ts:134–174  ·  view source on GitHub ↗
({
  line,
  styleId,
  viewportWidth = 80,
  viewportHeight = 10,
}: {
  line: string
  styleId: number
  viewportWidth?: number
  viewportHeight?: number
})

Source from the content-addressed store, hash-verified

132}
133
134function makeStyledLineFrame({
135 line,
136 styleId,
137 viewportWidth = 80,
138 viewportHeight = 10,
139}: {
140 line: string
141 styleId: number
142 viewportWidth?: number
143 viewportHeight?: number
144}): Frame {
145 const screen = createScreen(
146 viewportWidth,
147 1,
148 stylePool,
149 charPool,
150 hyperlinkPool,
151 )
152
153 for (let x = 0; x < line.length; x += 1) {
154 setCellAt(screen, x, 0, {
155 char: line[x]!,
156 styleId,
157 width: CellWidth.Narrow,
158 hyperlink: undefined,
159 })
160 }
161
162 return {
163 screen,
164 viewport: {
165 width: viewportWidth,
166 height: viewportHeight,
167 },
168 cursor: {
169 x: 0,
170 y: 1,
171 visible: true,
172 },
173 }
174}
175
176function findClearTerminalPatch(diff: Diff) {
177 return diff.find(

Calls 2

createScreenFunction · 0.85
setCellAtFunction · 0.85

Tested by

no test coverage detected