Repository navigation
views(fix[region]): Track live coordinates - #211
Merged
Merged
Conversation
why: Retained live RegionViews held references to mutable _Row objects, so scrolling reordered rows and reflow replaced backing rows out from under live regions and nested crops. Out-of-bounds vertically shrunk live RowViews could also fall back to recycled _Row instances. what: - Bind screen-backed RegionView instances and nested crops to Screen and validated contiguous coordinate ranges clipped on each read, removing the stale _live_rows dual shim. - Canonicalize empty inverted slice ranges in _slice_indices and validate range bounds and screen/live bindings in RegionView, RowView, and slice_grid. - Return a shared empty 0-col FrozenRow from live RowView._current_row while vertically out of bounds so shrunk rows never alias recycled rows and resume when the screen grows back. - Resolve current rows in Screen.blit and keep Snapshot and Snapshot.viewport regions immutable and isolated. - Add scroll, reflow, resize, crop-edge wide/grapheme, inverted-slice, validation, self-blit, and vertical-shrink regression tests. - Update docs/topics/snapshots.md (with executable doctest) and CHANGES. Fixes #197
35 of 38 tasks
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RegionViewinstances and nested crops to theirScreenand validated contiguous coordinate ranges clipped on every read, removing the stale_live_rowsdual shim so retained live regions stay aligned across scroll up/down,DECSTBM, reflow, and resize.FrozenRowfrom liveRowView._current_rowwhen vertically out of bounds so shrunk rows never alias recycled_Rowinstances and cleanly resume when grown back._slice_indices/_normalize_rangeand validate range bounds,row_rangelength, andscreen/livebindings acrossRegionView,RowView, andslice_grid.Screen.blitwhile keepingSnapshotandSnapshot.viewport()regions immutable and isolated.docs/topics/snapshots.md, and aCHANGESentry.Fixes #197