documents: Ctrl+V with no block open pastes text at the caret
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:
1 parent
013f14216f
commit
1b5fb07cda
3 files changed
+17
-2
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user