Skip to content

fix(table): ignore cells past the delimiter column count - #178

Merged
gnacho merged 1 commit into
masterfrom
fix/176-table-overflow
Nov 9, 2026
Merged

gnacho merged 1 commit into
masterfrom
fix/176-table-overflow

Conversation

@gnacho

@gnacho gnacho commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Fixes the startup crash reported in #176.

A table row with more cells than the delimiter row defines produced a
CanvasLayout whose per-row cells outnumbered col_widths. Painting
then indexed col_widths[ci] out of bounds and panicked with
index out of bounds: the len is 4 but the index is 4.

The layout now ignores cells past the delimiter column count, matching
GFM where the delimiter row defines the number of columns. The source
text is untouched: only the painted canvas drops the excess cells.

Adds a regression test that feeds a 5-cell row under a 4-column
delimiter and asserts no row outnumbers the columns.

Closes #176

A row with more cells than the delimiter row defines produced a layout
whose cells outnumbered col_widths, so painting indexed col_widths[ci]
out of bounds and panicked with "index out of bounds" on startup.

Closes #176
@gnacho gnacho mentioned this pull request Nov 9, 2026
@gnacho
gnacho merged commit ab5e044 into master Nov 9, 2026
3 checks passed
@gnacho
gnacho deleted the fix/176-table-overflow branch November 9, 2026 23:16
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.

Crash on startup...

1 participant