documents: Ctrl+V with no block open pastes text at the caret
CI / platforms (windows-latest) (push) Failing after 8s
CI / site (push) Successful in 22s
CI / crate (push) Failing after 11m50s
CI / platforms (ubuntu-24.04) (push) Canceled after 0s

It pasted only pictures; text was dropped without a word.

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-14 18:20:11 -04:00
1 parent 013f14216f
commit 1b5fb07cda
3 files changed
+17 -2

No files matched your search

+7 -1
View File
@@ -281,7 +281,13 @@ impl Render for MarkdownDocument {
}
}))
.on_action(cx.listener(|document, _: &Paste, _, cx| {
document.paste_picture(cx);
if document.paste_picture(cx) {
return;
}
match cx.read_from_clipboard().and_then(|item| item.text()) {
Some(text) => _ = document.insert(&text, cx),
None => log::info!("markdown document: nothing to paste"),
}
}))
.capture_action(cx.listener(|document, _: &forms::Enter, _, cx| {
if document.block_newline(cx) {