documents: an empty visual document opens its end on focus
CI / platforms (windows-latest) (push) Failing after 9s
CI / site (push) Successful in 22s
CI / crate (push) Failing after 11m48s
CI / platforms (ubuntu-24.04) (push) Canceled after 0s

Typing in a new file lands with no press.

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 03:52:55 -04:00
1 parent f59c9f7f50
commit 6f0401e967
3 files changed
+47 -6

No files matched your search

+10 -6
View File
@@ -105,11 +105,15 @@ impl MarkdownDocument {
.hide_indent_guides()
.highlighter(markdown_highlights)
});
let subscriptions = vec![cx.subscribe(&editor, |document, _, event, cx| {
if *event == EditorEvent::Changed {
document.changed(cx);
}
})];
let focus = cx.focus_handle();
let subscriptions = vec![
cx.subscribe(&editor, |document, _, event, cx| {
if *event == EditorEvent::Changed {
document.changed(cx);
}
}),
cx.on_focus(&focus, window, Self::focused),
];
let overdraw = window.rem_size() * 40.0;
let mut document = Self {
editor,
@@ -123,7 +127,7 @@ impl MarkdownDocument {
top: None,
asks: 0,
writes: 0,
focus: cx.focus_handle(),
focus,
on_link: None,
_subscriptions: subscriptions,
};