feat(buffer): logical line storage for wrapped rows#5958
Closed
Tyriar wants to merge 1 commit into
Closed
Conversation
Introduce BufferOverflowLine rows that share cell storage with a parent BufferLine head, implementing the logical-line model from issue #4800. - Extend BufferLine with logical capacity and segment-aware indexing - Add BufferOverflowLine, BufferLineUtils helpers, and unit tests - Expose attachWrappedRow/clearWrappedRow on Buffer for future integration - Keep InputHandler on isWrapped flag until reflow/SL paths are updated Reflow still uses per-row buffers; materializeLogicalLinesForReflow helpers are included for a follow-up that simplifies resize reflow. Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
Contributor
|
It's late, and I haven't had a chance to understand this change. However, I should point out that I believe that PR #5797 is a cleaner and more refined variation of the ideas in issue #4800: Instead of dealing with "overflow lines" it explicitly uses a LogicalLine class. PR #5853 builds on PR #5797 in also re-implementing Markers. |
Member
Author
|
@PerBothner this is just me experimenting with a throw away agent implementation, I didn't want it to make the PR (still figuring out how to do that). |
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
Implements the logical-line model described in #4800 for wrapped buffer rows: continuation rows share the parent
BufferLinecell storage instead of duplicating data and relying onisWrappedon each physical row.Changes
BufferLine: supports extended logical capacity (logicalCellCount) and segment-aware cell indexing via_segmentStartBufferOverflowLine: viewport row that views a slice of the parent line's shared_data/ attribute mapsBufferLineUtils: helpers to attach/clear wrapped rows, flatten logical groups for reflow, and create scroll-wrapped linesBufferAPI:attachWrappedRow,clearWrappedRow,createScrollWrappedLineInputHandler:_unwrapBufferRowhandles logical overflow rows when clearing wrap (e.g. backspace, erase); print path still usesisWrappeduntil reflow/SL integration is completedBufferLogicalLine.test.tscovers shared storage across wrapped rowsFollow-up (not in this PR)
attachWrappedRowinto theInputHandlerprint/wrap hot pathmaterializeLogicalLinesForReflowbefore buffer reflow to simplify_reflowSmaller/_reflowLarger(avoid copying cells between rows that already share storage)BufferService.scrollTesting
npm run test-unit -- out-esbuild/common/buffer/ out-esbuild/common/InputHandler.test.js(316 passing)npm run lint-changes