Skip to content

fix(table): per-row wrap height for cursor motion (follow-up to #665) - #680

Open
sentinelt wants to merge 18 commits into
MeanderingProgrammer:mainfrom
sentinelt:fix/table-wrap-cursor-motion
Open

fix(table): per-row wrap height for cursor motion (follow-up to #665)#680
sentinelt wants to merge 18 commits into
MeanderingProgrammer:mainfrom
sentinelt:fix/table-wrap-cursor-motion

Conversation

@sentinelt

@sentinelt sentinelt commented Aug 3, 2026

Copy link
Copy Markdown

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/k from that row to the next only advanced one buffer line, because extra height lived on the last table row as pooled virt_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):

  1. Paint visual lines onto that line’s wrap slots when available.
  2. Put any remaining visual lines as virt_lines on the same row.

virtual_lines remain visible under anti-conceal by default, so multi-line height is preserved for motion when the cursor is on a row.

MaxDillon and others added 18 commits June 6, 2026 19:02
`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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants