3.2 KiB
3.2 KiB
Requests for page.rs / page_list.rs (from the Screen port)
- Pin-based iterators (Zig
PageList.zig~5100-5170):Pin::{row_iterator, cell_iterator, page_iterator, prompt_iterator}(direction, limit: Option<Pin>). The limit pin is inclusive and applies at row granularity. Screen uses a local copy inpin_iter.rs. PageList::set_tracked_pinvalidity: it rejects pins withy >= node.size.rows. Zig writes the pin raw;Screen::split_for_capacitytemporarily restores the cursor to the pre-split node, which may have shrunk. Worked around with a clamped stand-in.- Cross-page row clone: Zig
Page.cloneRowFrom(other_page, ...)between two nodes of one list needs two page borrows. Screen implements it withexport_cell/import_cell(Screen::clone_row_between). APageList::clone_row_between(src_pin, dst_pin)would be better. - String allocator probing:
Page.string_allocis private; ZigcursorSetHyperlinkprobes it before growing. Screen instead re-adds the cursor hyperlink afterincrease_capacity. Alsoinsert_hyperlinkallocates strings before checking set dedup, so near-full pages can fail needlessly. fixup_viewportmust handleViewport::Topaftererase_rows(Zig PageList.zig ~3043-3070). Worked around inScreen::erase_rows.- Resize reflow / no-reflow fewer rows must drop trailing blank rows, including rows holding only bg-color cells (Zig
resizeCols/resizeWithoutReflow). Three Screen tests are#[ignore = "pagelist: ..."]:screen_resize_no_reflow_less_rows_trims_blank_lines,screen_resize_less_cols_with_reflow_but_row_space,screen_resize_less_cols_to_wrap_wide_char. PageList::resetanderase_rowsreturnResult;erase_rowswith an empty history start point returnsInvalidCoordinate(Zig would assert). Screen guards/ignores.
- (T3/p4)
erase_row_boundedmust reset row flags on the blanked row: after rotating, the final row is cleared withPage::clear_cells, which leavesrow.hyperlink/styled/graphemeset. Zig's row is left with the flags cleared (testTerminal: index bottom of scroll region clear hyperlinksexpects!row.hyperlink; ignored asterminal_index_bottom_of_scroll_region_clear_hyperlinks). - (T3/p8) Reflow to fewer cols with a pending-wrap cursor: 4x2 screen printed "0123",
resize(2,2)with reflow gives screen contents "01\n23" but the active area/viewport dump is only "23" (active top is one row too low; Zig yields "01\n23"). Ignored test:terminal_resize_with_wraparound_on. - (T3/p1)
Page::set_graphemes/Page::append_graphememust not mark the row dirty (ZigPage.appendGraphemeleaves dirty untouched; callers likeTerminal.printmark dirty explicitly). Terminal works around it for the zero-width path (testterminal_ignored_vs16_doesnt_mark_dirty). - (T3/terminal)
PageList::clone_partial_row_between(src_pin, dst_pin, left, right): Terminalinsert_lines/delete_linesneed Zig'sPage.clonePartialRowFrombetween two different page nodes of one list (needs two page borrows).terminal.rs::clone_partial_row_betweenre-implements it viaexport_cell/import_cell(nowpub(crate)use) plus the row-metadata merge fromPage::clone_partial_row_from.