Skip to content

fix(text): compute is_last per-block in non-scrollable render path#2093

Open
sassman wants to merge 1 commit intolongbridge:mainfrom
steganogram:feat/panels
Open

fix(text): compute is_last per-block in non-scrollable render path#2093
sassman wants to merge 1 commit intolongbridge:mainfrom
steganogram:feat/panels

Conversation

@sassman
Copy link

@sassman sassman commented Feb 25, 2026

Fixes #2092.

In ParsedDocument::render_root, the non-scrollable path passed is_last: true to every block via a shared NodeRenderOptions.

Since render_block sets mb = rems(0.) when is_last, no block ever received a bottom margin — making paragraph_gap, heading spacing, and --- divider spacing invisible.

Fix: compute is_last per-block (matching what the virtualized-list path already does).

All blocks were given is_last=true via a shared NodeRenderOptions,
causing every block's margin-bottom to resolve to rems(0). Paragraph
spacing set via TextViewStyle::paragraph_gap had no visible effect.

Mirror the virtualized-list path: compute is_last per block so only
the final block gets zero bottom spacing.

Signed-off-by: Sven Kanoldt <sven@d34dl0ck.me>
@huacnlee huacnlee self-assigned this Feb 26, 2026
@huacnlee
Copy link
Member

huacnlee commented Feb 26, 2026

Please upload a screenshot to show me the before/after change.

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.

TextView: Markdown renders without block spacing in non-scrollable mode

2 participants