documents and editor: typewriter room at both ends, open blocks scaled, a resize re-centers
CI / platforms (windows-latest) (push) Failing after 8s
CI / site (push) Successful in 25s
CI / crate (push) Failing after 11m6s
CI / platforms (ubuntu-24.04) (push) Canceled after 0s

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-12 08:54:41 -04:00
1 parent 508fee9d15
commit f102ea0b6c
6 files changed
+189 -14

No files matched your search

+16 -2
View File
@@ -42,8 +42,19 @@ pub(crate) fn bind_keys(cx: &mut App) {
}
impl MarkdownDocument {
/// List item `ix`: a block, or the end.
fn item(&mut self, ix: usize, _: &mut Window, cx: &mut Context<Self>) -> AnyElement {
/// List item `ix`, with typewriter room at the ends.
fn item(&mut self, ix: usize, window: &mut Window, cx: &mut Context<Self>) -> AnyElement {
let (first, last) = (ix == 0, ix == self.parsed.blocks.len());
let room = self.room;
div()
.when(first, |item| item.pt(room))
.when(last, |item| item.pb(room))
.child(self.block_item(ix, window, cx))
.into_any_element()
}
/// A block, or the end.
fn block_item(&mut self, ix: usize, _: &mut Window, cx: &mut Context<Self>) -> AnyElement {
let theme = cx.theme();
let colors = theme.colors.clone();
let (radius, body, mono) = (
@@ -57,6 +68,7 @@ impl MarkdownDocument {
let open = self.open.as_ref();
let field = |open: &super::Open| {
div()
.text_size(body)
.px_3()
.py_2()
.rounded(radius)
@@ -164,6 +176,8 @@ impl Render for MarkdownDocument {
cx.emit(super::Attachment::Files(dropped.paths().to_vec()));
}));
self.center_current(cx);
// Typewriter: half a view past each end.
self.make_room();
let blocks = list(self.list.clone(), cx.processor(Self::item)).size_full();
// The text column: its measure, font, centered.
let column = |content: gpui::AnyElement, look: &super::DocumentLook| {