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
// Hand-added (NOT generated by Qleany): the addressable-text accessor.
use ;
use crateAddressableTextResultDto;
use Result;
/// Hand the caller the document's **addressable text** — the exact string the document's
/// own offsets index into.
///
/// Every offset the document deals out lives in one char space: `find_all`/`find_text`
/// match positions, `replace_ranges` ranges, a block's `document_position`, a cursor or
/// an editor widget's selection. The string that space indexes is the text `find_all`
/// searches — which, until this use case, no caller could reach from a live document.
/// The only whole-document strings on offer were the plain-text *exports*, which omit
/// the `U+FFFC` anchor an embedded table occupies, so every offset taken against them
/// drifts by two characters per preceding table. That drift is not hypothetical: a
/// comment anchored on prose after a table captured its quote two characters off
/// (`"salt-bleached"` stored as `"lt-bleached d"`).
///
/// Implemented as *literally* `find_all`'s own text builder behind `find_all`'s own
/// unit-of-work type — not a lookalike walk — so the string returned here and the string
/// searched there are one definition. If the builder changes, both change together.