({
line,
styleId,
viewportWidth = 80,
viewportHeight = 10,
}: {
line: string
styleId: number
viewportWidth?: number
viewportHeight?: number
})
| 132 | } |
| 133 | |
| 134 | function 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 | |
| 176 | function findClearTerminalPatch(diff: Diff) { |
| 177 | return diff.find( |
no test coverage detected