Documents: an open block keeps its look
CI / platforms (ubuntu-24.04) (push) Waiting to run
CI / platforms (windows-latest) (push) Failing after 2s
CI / crate (push) Failing after 2s
CI / site (push) Successful in 24s

The open field sits in the closed block's frame at its size, line
height and weight; headings keep their step. Code and math keep their
panel. Typewriter centering also keys on the ends' room, so a block
opened at the same height still centers.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-16 14:01:58 -04:00
1 parent cdc5ce8247
commit bff7ebcd64
7 files changed
+150 -34

No files matched your search

+3 -3
View File
@@ -90,9 +90,9 @@ impl MarkdownDocument {
block.size.height -= self.room;
}
let view = self.list.viewport_bounds();
// A new layout or a resize moves it too.
let heights =
[block.size.height, view.size.height].map(|height| f32::from(height).round() as u64);
// A new layout, a resize or the ends' room moves it.
let heights = [block.size.height, view.size.height, self.room]
.map(|height| f32::from(height).round() as u64);
let moved = (ix, self.edits, self.typed, heights);
if self.centered == Some(moved) {
return;