Skip to content
This repository was archived by the owner on Nov 12, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions apps/leaf-tui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3511,14 +3511,18 @@ mod tests {
// status is the assertion rather than the pasteboard itself: `^c` with
// the bar up used to be swallowed, and "copied" is exactly the report
// that it no longer is. What lands on the pasteboard is
// `copy_publishes_both_flavors`' business.
// `copy_publishes_both_flavors`' business. Where there is no
// pasteboard (a headless Linux box) the verb still runs, and says so.
assert_eq!(doc.selected_text(), Some("needle"));
handle_key(&mut doc, ctrl('c'), &mut app);
assert!(app.find.is_some(), "the bar stays up over a copy");
assert_eq!(
doc.status.as_deref().map(|s| s == "copied"),
Some(true),
"^c must reach the host's clipboard verb, not be eaten by the bar"
assert!(
matches!(
doc.status.as_deref(),
Some("copied" | "clipboard unavailable")
),
"^c must reach the host's clipboard verb, not be eaten by the bar: {:?}",
doc.status
);

// ^P closes the bar first: the palette can run an editing command over
Expand Down
1 change: 1 addition & 0 deletions docs/tasks/closed/closed.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ contents:
- '[Following a fragment lands before its heading](/docs/tasks/closed/fragment-lands-before-heading.md)'
- '[Split leaf-dioxus into a widget crate and its app](/docs/tasks/closed/split-leaf-dioxus-into-a-widget-crate-and-its-app.md)'
- '[Place the Dioxus editor in part of a window](/docs/tasks/closed/place-the-dioxus-editor-in-part-of-a-window.md)'
- '[The heading the caret is under is a question `Doc` cannot answer](/docs/tasks/closed/heading-at-offset.md)'
---

# Closed tasks
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
---
status: open
status: done
created: 2026-09-16
updated: 2026-10-06
part_of: '[Tasks](/docs/tasks/tasks.md)'
updated: 2026-10-21
part_of: '[Closed tasks](/docs/tasks/closed/closed.md)'
---
# The heading the caret is under is a question `Doc` cannot answer

**Status.** Open: the leaf half is in, provui's is not. `feat(core):
heading_at — the heading a place in the document is under` adds
`Doc::heading_at` / `heading_at_caret` and the `Heading` type, in the shape
below, and exposes both through leaf-ffi and the wasm binding as a
`HeadingView` (`text`, `level`, `start`, `end`). What remains is provui's,
and it waits on nothing now: provui takes leaf from git, and its lock
(`17dd988`, 2026-10-06) already carries `heading_at`. `DocumentSession::heading_at_caret`
delegates to leaf, and `twig` leaves `provui-core`'s manifest.
**Status: done.** The leaf half is `feat(core): heading_at — the heading a
place in the document is under` (`d15bbb7`), which adds `Doc::heading_at` /
`heading_at_caret` and the `Heading` type, in the shape below, and exposes
both through leaf-ffi and the wasm binding as a `HeadingView` (`text`,
`level`, `start`, `end`); `heading_at_caret_is_the_nearest_heading_above` in
`doc/tests/links.rs` is the test the done-when asks for. provui's half is
`refactor(core)!: ask leaf for the heading under the caret instead of parsing
the body again` (provui `d512e25`, diaryx-org/provui#5):
`DocumentSession::heading_at_caret` delegates to leaf, and `twig` has left
`provui-core`'s manifest.

**Where.** `crates/leaf-core/src/doc/under_caret.rs`, beside `link_destination_at_caret`
and `locate`.
Expand Down
1 change: 0 additions & 1 deletion docs/tasks/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ updated: 2026-10-04
contents:
- '[Writing Tools in the Apple views](writing-tools.md)'
- '[Right-to-left text](right-to-left-text.md)'
- '[The heading the caret is under is a question `Doc` cannot answer](heading-at-offset.md)'
- '[`can_undo` counts edits, and twig counts steps](can-undo-counts-edits-not-steps.md)'
- '[The Mac app runs unsandboxed](sandboxed-mac-app.md)'
- '[Enter in an HTML document writes whitespace](enter-in-html-writes-whitespace.md)'
Expand Down
Loading