documents: right presses keep a selection; Delete Image
A right press in a text field or the code editor keeps a selection it lands in, else moves the caret. In visual mode a right press in the open block keeps it open and emits Pointed, read apart from the whole text. MarkdownDocument::delete_image removes the picture at the caret. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
6c2d28c56e
commit
013f14216f
9 files changed
+284
-5
No files matched your search
@@ -72,8 +72,15 @@ impl MarkdownDocument {
|
||||
// Focus fades all but the reader's block.
|
||||
let faded = self.look.focus && editing_mode(self.mode) && ix != self.current_block(cx);
|
||||
let open = self.open.as_ref();
|
||||
let point = cx.listener(|document, _: &MouseDownEvent, window, cx| {
|
||||
window.prevent_default();
|
||||
cx.stop_propagation();
|
||||
document.point_open(cx);
|
||||
});
|
||||
let field = |open: &super::Open| {
|
||||
div()
|
||||
.debug_selector(|| "markdown-open".to_string())
|
||||
.on_mouse_down(MouseButton::Right, point)
|
||||
.text_size(body)
|
||||
.px_3()
|
||||
.py_2()
|
||||
|
||||
Reference in new issue
Block a user