Skip to content

fix: use usable column count for display width (#178)#181

Merged
dnouri merged 1 commit intomasterfrom
fix/178-table-width-line-numbers
Apr 4, 2026
Merged

fix: use usable column count for display width (#178)#181
dnouri merged 1 commit intomasterfrom
fix/178-table-width-line-numbers

Conversation

@dnouri
Copy link
Copy Markdown
Owner

@dnouri dnouri commented Apr 4, 2026

Tables and tool-output previews overflowed when
display-line-numbers-mode was active because the width
calculation used window-width, which includes the columns
reserved for line numbers.

Switch --chat-window-width to window-max-chars-per-line,
which returns only the columns available for buffer text.
Consolidate the two bare (or (window-width) 80) calls in
render.el behind the same accessor (now --chat-display-width)
so every consumer benefits from the fix.

Defer the width query in streaming decoration until tree-sitter
has actually found a table region, avoiding the call on the
majority of deltas that contain no pipe tables.

Verified in both terminal and GUI (xvfb) Emacs — 830 unit tests green, 15/15 manual scenarios pass in each environment.

Tables and tool-output previews overflowed when
`display-line-numbers-mode' was active because the width
calculation used `window-width', which includes the columns
reserved for line numbers.

Switch `--chat-window-width' to `window-max-chars-per-line',
which returns only the columns available for buffer text.
Consolidate the two bare `(or (window-width) 80)' calls in
render.el behind the same accessor (now `--chat-display-width')
so every consumer benefits from the fix.

Defer the width query in streaming decoration until tree-sitter
has actually found a table region, avoiding the call on the
majority of deltas that contain no pipe tables.
@dnouri dnouri merged commit be5a2b0 into master Apr 4, 2026
11 checks passed
@dnouri dnouri deleted the fix/178-table-width-line-numbers branch April 4, 2026 10:49
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.

1 participant