Fixes #5237. Fix Markdown table row height calculation#5238
Merged
Conversation
Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/45793f28-879a-4343-aeae-67c066c28785 Co-authored-by: tig <585482+tig@users.noreply.github.com>
… triggers EndInit cascade Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/45793f28-879a-4343-aeae-67c066c28785 Co-authored-by: tig <585482+tig@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix incorrect table row calculations in Markdown
Fixes #5765. Fix Markdown table row height calculation
May 7, 2026
BDisp
approved these changes
May 7, 2026
tig
added a commit
that referenced
this pull request
May 7, 2026
* Initial plan * Initial investigation - identified root cause of table height bug Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/45793f28-879a-4343-aeae-67c066c28785 Co-authored-by: tig <585482+tig@users.noreply.github.com> * Fix table row height calculation: capture RenderedHeight before Add() triggers EndInit cascade Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/45793f28-879a-4343-aeae-67c066c28785 Co-authored-by: tig <585482+tig@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tig <585482+tig@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
Markdown- Table row calculations incorrect #5237Initial layout of a Markdown view with a large table produces extra blank lines after the table. Resizing the terminal corrects the layout.
Proposed Changes/Todos
BuildRenderedLinesRoot Cause
Add(tableView)triggersEndInit()→Layout()→OnSubViewLayout→Recalculate(Frame.Width)using a stale content width from the previous layout pass. This overwritesRenderedHeightwith an incorrect value before it's read for placeholder line reservation.Fix
Capture
RenderedHeightimmediately afterRecalculate(tableLayoutWidth)and beforeAdd(tableView):Previously
tableView.RenderedHeightwas read afterAdd(tableView), by which point the value had been corrupted by the initialization cascade.Pull Request checklist:
CTRL-K-Dto automatically reformat your files before committing.dotnet testbefore commit///style comments)