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
//! Live Grep "Return to Work" cache (issue #1796).
//!
//! Holds the prior search query, the prior selected result index, and a
//! display cache of the matches that were on screen when the user last
//! dismissed the floating overlay. `Action::ResumeLiveGrep` reads this
//! to re-open the overlay in the same state, *without* re-running
//! ripgrep — this is what enables the issue-#1796 flow of flipping
//! between editing a result and viewing the next match.
//!
//! `cached_results` is invalidated as soon as the user edits the query
//! (any keystroke that mutates the prompt input). Saved snapshots
//! exported to the Quickfix dock carry their own copies — this struct
//! is purely a *display* aid, never a correctness contract.
use Instant;
/// One captured Live Grep match. Mirrors the JSON shape that the
/// `live_grep.ts` plugin already speaks; we keep it in core (not in the
/// plugin) because the Quickfix export needs to land in a virtual
/// buffer owned by the editor, not by JS.
/// Cached Live Grep state for Resume.