documents: a press opens its block on the pressed character; a secondary press points

Each drawn text piece keeps its written span, so a press maps back to a
source byte. A secondary press opens nothing: it moves the caret there and
emits DocumentEvent::Pointed with the block's kind, link, picture and
whether it lies in a table or code. Block nodes count from their own start.

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 09:38:08 -04:00
1 parent 12512217bd
commit 5af11fe489
17 files changed
+813 -82

No files matched your search

+2 -2
View File
@@ -4,7 +4,7 @@ use std::ops::Range;
use gpui::{Context, Window};
use super::MarkdownDocument;
use super::{MarkdownDocument, edit::Landing};
use crate::documents::MarkdownMode;
impl MarkdownDocument {
@@ -42,7 +42,7 @@ impl MarkdownDocument {
return self.reveal(line(self, cx), window, cx);
};
let start = block.start;
self.open(Some(ix), false, window, cx);
self.open(Some(ix), Landing::End, window, cx);
self.list.scroll_to_reveal_item(ix);
if let Some(open) = &self.open {
let input = open.input.clone();