(screen: Screen, index: number)
| 641 | * index computation — caller must ensure index is valid. |
| 642 | */ |
| 643 | export function cellAtIndex(screen: Screen, index: number): Cell { |
| 644 | const ci = index << 1 |
| 645 | const word1 = screen.cells[ci + 1]! |
| 646 | const hid = (word1 >>> HYPERLINK_SHIFT) & HYPERLINK_MASK |
| 647 | return { |
| 648 | // Unwritten cells have charIndex=0 (EMPTY_CHAR_INDEX); charPool.get(0) returns ' ' |
| 649 | char: screen.charPool.get(screen.cells[ci]!), |
| 650 | styleId: word1 >>> STYLE_SHIFT, |
| 651 | width: word1 & WIDTH_MASK, |
| 652 | hyperlink: hid === 0 ? undefined : screen.hyperlinkPool.get(hid), |
| 653 | } |
| 654 | } |
| 655 | |
| 656 | /** |
| 657 | * Get a Cell at the given index, or undefined if it has no visible content. |
no test coverage detected