SEARCH.md
Type /term, hit enter, jumps to it
Bottom of screen says [M/N] indicating matches, then specifies "W [1/N]" when wrapping
With default settings:
There is a setting (redrawtime) that specifies max time
spent finding matches
hlsearch indicates whether results are highlighted when done searching
incsearch indicates whether results are highlighted while typing term
No highlighting as you type or after searching
Need to store last search term
Need to store list of matches
Do we need to store a index of our last jump anywhere?
n/N or */#)
{
a: "apple",
b: [
"cherry",
"date",
],
c: "cherry",
}
{
a: "apple",
b: ["cherry", "date"],
c: "cherry",
}
When a match is found in a collapsed container (e.g., searching for
cherry above while b is highlighted), we will jump to that key/row,
and display a message "There are N matches inside this container", then
next search will continue after the collapsed container.
struct SearchState {
mode: enum { Key, Free },
direction: enum { Down, Up },
search_term: String,
compiled_regex: Regex,
matches: Vec<Range<usize>>,
last_jump: usize,
actively_searching: bool,
}
/ Start freeform search
? Start reverse freeform search
* Start object key search
# Start reverse object key search
n Go to next match
N Go to previous match
When starting search =>
false
W? [M/N]