documents: a right press in an open block targets the pressed byte
The open block's target was read at the selection's start and from the syntax tree only, so a press on the second of two selected links named the first, and an inline anchor read as its outer link. point_open now reads the byte under the press and resolves links as drawing does; delete_image takes that byte. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
6df9ab0aa6
commit
79e94f7e24
6 files changed
+165
-36
No files matched your search
@@ -29,9 +29,10 @@ impl MarkdownDocument {
|
||||
)
|
||||
}
|
||||
|
||||
/// Removes the picture at the caret, read apart.
|
||||
pub fn delete_image(&mut self, cx: &mut Context<Self>) -> Result<(), EditRefusal> {
|
||||
self.apart("delete image".to_string(), drop_image, cx)
|
||||
/// Removes the picture at source byte `at`, read apart.
|
||||
pub fn delete_image(&mut self, at: usize, cx: &mut Context<Self>) -> Result<(), EditRefusal> {
|
||||
let drop = move |full: &str, _| drop_image(full, at);
|
||||
self.apart("delete image".to_string(), drop, cx)
|
||||
}
|
||||
|
||||
/// `command` at the caret, read apart; refusals by event.
|
||||
|
||||
Reference in new issue
Block a user