Skip to content

fix(renderer): use visual width for table wrap check#518

Closed
ImmanuelHaffner wants to merge 1 commit into
OXY2DEV:mainfrom
ImmanuelHaffner:fix-table-wrap-visual-width
Closed

fix(renderer): use visual width for table wrap check#518
ImmanuelHaffner wants to merge 1 commit into
OXY2DEV:mainfrom
ImmanuelHaffner:fix-table-wrap-visual-width

Conversation

@ImmanuelHaffner

@ImmanuelHaffner ImmanuelHaffner commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

The table wrap check used vim_width (raw text width including concealed content like URLs) to decide whether to skip rendering. This caused tables with long hyperlinks to not render at all when wrap is enabled, even though the visual width after conceal was well within the window. The whole table lost its padding and borders, so column-2 right borders appeared shifted far off, worsening with URL length.

Use col_widths (visual width after conceal resolution) instead, which correctly reflects the rendered table width.

Adds test/table_wrap_link_border.md as a visual repro (wrap enabled, long URLs in cells); with the fix, every column-2 right border aligns once the cursor is off the table and the URLs conceal.

The table wrap check used vim_width (raw text width including concealed
content like URLs) to decide whether to skip rendering. This caused
tables with long hyperlinks to not render at all when wrap is enabled,
even though the visual width after conceal was well within the window.
The whole table lost its padding and borders, so column-2 right borders
appeared shifted far off, worsening with URL length.

Use col_widths (visual width after conceal resolution) instead, which
correctly reflects the rendered table width.

Add test/table_wrap_link_border.md as a visual repro (wrap enabled, long
URLs in cells); every column-2 right border must align once the cursor
is off the table and the URLs conceal.
@OXY2DEV

OXY2DEV commented Jul 4, 2026

Copy link
Copy Markdown
Owner

@ImmanuelHaffner text wrapping is separate from conceals. They are incompatible at the moment.

The lines total width(before concealing) is used for text wrapping which is why you can see empty lines when long links are wrapped.

This needs to be fixed upstream. The solution given in this PR was already tested before, it doesn't work correctly in a lot edge cases.

@OXY2DEV OXY2DEV closed this Jul 4, 2026
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.

2 participants