(screen: Screen, index: number)
| 600 | * index computation — caller must ensure index is valid. |
| 601 | */ |
| 602 | export function cellAtIndex(screen: Screen, index: number): Cell { |
| 603 | const ci = index << 1 |
| 604 | const word1 = screen.cells[ci + 1]! |
| 605 | const hid = (word1 >>> HYPERLINK_SHIFT) & HYPERLINK_MASK |
| 606 | return { |
| 607 | // Unwritten cells have charIndex=0 (EMPTY_CHAR_INDEX); charPool.get(0) returns ' ' |
| 608 | char: screen.charPool.get(screen.cells[ci]!), |
| 609 | styleId: word1 >>> STYLE_SHIFT, |
| 610 | width: word1 & WIDTH_MASK, |
| 611 | hyperlink: hid === 0 ? undefined : screen.hyperlinkPool.get(hid), |
| 612 | } |
| 613 | } |
| 614 | |
| 615 | /** |
| 616 | * Get a Cell at the given index, or undefined if it has no visible content. |
no test coverage detected