1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! The "see the manual" footnote a modal appends to its body.
//!
//! Several modals end with one line pointing at the section of the
//! shipped manual that explains what the modal just said. The line is
//! built here rather than in each modal for the usual reason: its
//! link's coordinates are `(line index, span index)` into the finished
//! body, and a modal whose body has optional paragraphs (a warning row
//! that only sometimes appears, a folded-in explanation) cannot state
//! that index up front. Appending through one helper means the index
//! is *observed* rather than assumed, so it cannot drift out of step
//! with the body above it.
//!
//! Only modals that are **informational** carry one. On a modal that
//! asks a question — the images / diagrams / remote-image prompts,
//! with their Yes / No / Always / Never rows — following a link would
//! close the prompt, and closing those prompts *is* an answer ("no,
//! for this session"). A reader who clicked through to the manual to
//! decide would find the decision already made for them, which is
//! worse than having no link at all.
use ;
use ModalOutcome;
use crateTheme;
use crate;
/// A one-line pointer into the manual, appended below a modal's body.
pub
/// Close the modal and follow `target`.
///
/// The modal closes rather than staying open behind the manual: the
/// destination is a document, and an overlay left floating over the
/// page the reader just asked for covers the thing they came to read.
/// A modal with dismissal bookkeeping of its own (the capabilities
/// notice records the terminal fingerprint) builds its own outcome
/// instead, so the bookkeeping still runs.
pub