diff --git a/apps/leaf-tui/src/main.rs b/apps/leaf-tui/src/main.rs index 912c7821..2203d357 100644 --- a/apps/leaf-tui/src/main.rs +++ b/apps/leaf-tui/src/main.rs @@ -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 diff --git a/docs/tasks/closed/closed.md b/docs/tasks/closed/closed.md index e768fcc6..b37c256e 100644 --- a/docs/tasks/closed/closed.md +++ b/docs/tasks/closed/closed.md @@ -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 diff --git a/docs/tasks/heading-at-offset.md b/docs/tasks/closed/heading-at-offset.md similarity index 69% rename from docs/tasks/heading-at-offset.md rename to docs/tasks/closed/heading-at-offset.md index 73107d9c..06369eb0 100644 --- a/docs/tasks/heading-at-offset.md +++ b/docs/tasks/closed/heading-at-offset.md @@ -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`. diff --git a/docs/tasks/tasks.md b/docs/tasks/tasks.md index 4db1ee7a..14e5fcd1 100644 --- a/docs/tasks/tasks.md +++ b/docs/tasks/tasks.md @@ -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)'