documents: an empty visual document opens its end on focus
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:
1 parent
f59c9f7f50
commit
6f0401e967
3 files changed
+47
-6
No files matched your search
@@ -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,
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user