Commit 04c637c
committed
fix: seed new tab grid with window size, not panel size
add_context fed current.dimension straight into ContextGrid::new for
single-panel tabs. After apply_taffy_layout has run on the old tab,
that dimension carries panel-sized width/height (= window − scaled
margin) with margin zeroed. ContextGrid::new then stored those panel
dimensions as self.width/self.height — its idea of the window size —
and try_update_size subtracted the margin a second time on every
later call.
The break only surfaced once update_scaled_margin started syncing
Taffy's root via try_update_size: closing the original tab so the
freshly-spawned tab survived made resize_top_or_bottom_line(1) ask
Taffy for window_h − 34 − 2 instead of window_h − 2, leaving a tab-
bar-sized gap at the bottom after hide_if_single hid the strip.
Closing the new tab and keeping the original masked it because the
original grid was built with window dimensions at Screen::new and
nothing rewrites self.width/self.height afterwards.
Always rebuild the dimension from the current grid via
grid_dimension(), which composes self.width/self.height (window size)
with the unscaled margin. The split-only branch becomes redundant
since grid_dimension() already produces the correct value for both
single-panel and multi-panel grids.1 parent e351b89 commit 04c637c
1 file changed
Lines changed: 12 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1098 | 1098 | | |
1099 | 1099 | | |
1100 | 1100 | | |
1101 | | - | |
1102 | | - | |
1103 | | - | |
1104 | | - | |
1105 | | - | |
1106 | | - | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
1107 | 1112 | | |
1108 | 1113 | | |
1109 | | - | |
| 1114 | + | |
1110 | 1115 | | |
1111 | 1116 | | |
1112 | 1117 | | |
| |||
0 commit comments