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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//! Damage tracking — what changed since the last reset, as line + column spans.
//! See ADR-0003 for the model (incremental bounds, ack-gated reset).
/// The damaged column span of a single line.
///
/// **No `#[non_exhaustive]` (#844): nothing outside this crate has a reason to build one.** No
/// public function accepts it — the engine hands it out — and there are zero out-of-crate literal
/// sites, so the attribute would bind nothing it does not already bind.
/// A first-class scroll: rows `[top..=bottom]` shifted by `count` lines
/// (positive = up, negative = down). The renderer moves the rows instead of
/// redrawing them. Recorded by the engine — which executes the scroll — rather
/// than diff-detected (ADR-0003).
///
/// **A reported `count` never exceeds `bottom - top + 1`** — see
/// [`crate::Engine::scroll_delta`], which caps it. `count` is `isize` here and
/// `i16` on the wire, so an uncapped accumulation overflowed the field and
/// reversed the shift's direction (#661); the bound is also the point past which
/// the value stops meaning anything, since every source row is then outside the
/// region. The cap is applied when the op is *read*, not while it accumulates, so
/// a region that scrolls far and returns still reports its true small net.
///
/// **No `#[non_exhaustive]` (#844).** 7 out-of-crate literal sites. `{top, bottom, count}` is the
/// whole of a region shift, so nothing outside this crate can add to it.
/// What changed since the last `reset_damage()`.
///
/// **Deliberately exhaustive (#843).** A consumer that ignored a new damage kind
/// would render stale content with no error anywhere, so a new member is one the
/// compiler must make it look at. Left exhaustive on purpose, not by omission.
/// Per-line damage bounds. "Undamaged" is encoded as `left > right`, so an
/// untouched line never reports as damaged and the first `expand` sets a real
/// span. (Mirrors Alacritty's `LineDamageBounds`.)
pub