fix(table): per-row wrap height for cursor motion (follow-up to #665) - #680
Open
sentinelt wants to merge 18 commits into
Open
fix(table): per-row wrap height for cursor motion (follow-up to #665)#680sentinelt wants to merge 18 commits into
sentinelt wants to merge 18 commits into
Conversation
`render.md.table.Layout` was already introduced to `main`. Renamed the new `Layout` into `WrapLayout`.
Narrow windows with linebreak, showbreak, or breakindent move continuation screen-line starts. Wrapped table overlays must use the same slots or rows render under the continuation prefix.
Both the wrapped and regular cells.
Apply changes from MeanderingProgrammer#665 (continued work on table wrapping with virt lines, word-boundary wrap, alignment, indented tables, EOF bottom border fixes).
Overflow visual lines for wrapped cells were pooled onto the last table row. Moving between earlier rows with j/k only advanced one buffer line even when a row rendered as multiple screen lines. Assign each buffer row (header, delimiter, body) its own visual group and keep wrap-slot overlays plus overflow virt_lines on that row so motion jumps by the rendered multi-line height.
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
This is another incremental improvement on top of #665 (
feat(table): add cell wrapping using virt lines).It includes the table cell wrapping work from that PR, plus a navigation fix found while using the feature.
This change attaches overflow visual lines to each table buffer row instead of pooling them onto the last row.
Problem
With wrapping enabled, a body row can render as several screen lines. Moving with
j/kfrom that row to the next only advanced one buffer line, because extra height lived on the last table row as pooledvirt_lines. That made cursor motion feel wrong inside tall wrapped tables (e.g. long markdown cells).Solution
For each buffer line in the table (header, delimiter, body):
virt_lineson the same row.virtual_linesremain visible under anti-conceal by default, so multi-line height is preserved for motion when the cursor is on a row.