(y: number)
| 162 | } |
| 163 | |
| 164 | getLine(y: number): IBufferLine | undefined { |
| 165 | const wasmTerm = this.getWasmTerm(); |
| 166 | if (!wasmTerm) return undefined; |
| 167 | |
| 168 | // Check bounds |
| 169 | if (y < 0 || y >= this.length) { |
| 170 | return undefined; |
| 171 | } |
| 172 | |
| 173 | // Determine if accessing scrollback or visible screen |
| 174 | const scrollbackLength = wasmTerm.getScrollbackLength(); |
| 175 | let cells: GhosttyCell[] | null; |
| 176 | let lineNumber: number; |
| 177 | let isWrapped: boolean; |
| 178 | |
| 179 | if (this.bufferType === 'normal' && y < scrollbackLength) { |
| 180 | // Accessing scrollback |
| 181 | // WASM getScrollbackLine: offset 0 = oldest, offset (length-1) = newest |
| 182 | // Buffer coords: y=0 = oldest, y=(length-1) = newest |
| 183 | // So scrollbackOffset = y directly! |
| 184 | const scrollbackOffset = y; |
| 185 | cells = wasmTerm.getScrollbackLine(scrollbackOffset); |
| 186 | // TODO: We'd need WASM API to check if scrollback line is wrapped |
| 187 | // For now, assume not wrapped |
| 188 | isWrapped = false; |
| 189 | } else { |
| 190 | // Accessing visible screen |
| 191 | lineNumber = this.bufferType === 'normal' ? y - scrollbackLength : y; |
| 192 | cells = wasmTerm.getLine(lineNumber); |
| 193 | isWrapped = wasmTerm.isRowWrapped(lineNumber); |
| 194 | } |
| 195 | |
| 196 | if (!cells) { |
| 197 | return undefined; |
| 198 | } |
| 199 | |
| 200 | return new BufferLine(cells, isWrapped, wasmTerm.cols); |
| 201 | } |
| 202 | |
| 203 | getNullCell(): IBufferCell { |
| 204 | return this.nullCell; |
nothing calls this directly
no test coverage detected