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
@@ -36,8 +36,8 @@ pub use counts::{ReadingTime, WordCount};
pub use diagram::{Diagram, diagram_svg};
pub(crate) use diagram::{flatten, options as svg_options};
pub use document::{
Attachment, DocumentEvent, DocumentHeading, DocumentLook, LARGEST_READ, MarkdownDocument,
TableEdit, TableRefusal,
Attachment, DocumentEvent, DocumentHeading, DocumentLook, DocumentTarget, LARGEST_READ,
MarkdownDocument, TableEdit, TableRefusal, TargetBlock,
};
pub use epub::{Chapter, EpubReader};
pub use format::{Format, format};