Expand description
A tree’s filter: the query, how a node matches it, and the field that
types it (FilterField).
Matching: the query is cut into words at spaces; a node matches
when every word is somewhere in its match text
(TreeSource::match_text: its plain
name, plus the words its source adds), as a substring, ignoring case
and the accents of Latin letters (ecran finds Écran). Substrings
rather than a fuzzy subsequence (the command palette’s): a filter
hides what does not match, and a few letters in order are found in
almost any long description, so a fuzzy filter would hide nothing.
Substrings rather than word starts: board finds keyboard. This is
VS Code’s “contiguous” find mode for trees, with several words.
Showing: while the query is not empty, the nodes that match show
with their ancestors, which open without touching the fold the tree
keeps (opening or closing a branch meanwhile lasts until the query
changes, and runs no tree.expand); a branch that matches opens onto
all of its children. The rest is hidden; nothing left shows a “No
match” row. Only the nodes loaded are searched: a lazy branch never
opened is not asked for.
use egui_pop_views::tree::filter::Query;
let q = Query::new("ecran lum");
assert!(q.matches("Écran et luminosité"));
assert!(!q.matches("Écran"));
assert_eq!(q.positions("Écran"), [0, 1, 2, 3, 4]);Structs§
- Filter
Field - The field typing a tree’s filter, drawn above the tree (or anywhere near it) with the tree’s state.
- Query
- A filter’s query: its words, folded.
Constants§
- REPORTED_
ROWS - How many rows a tree reports to agents at most.
- SURFACE
- The focus surface of a tree drawn with a filter field: its keys
(
tree.filter’s Ctrl+F and/) are bound there (treeFilterFocus).
Functions§
- drawn
- The trees drawn so far, by id, as last reported: the filter, how many
nodes match it (
null: none set) of how many are loaded, and the rows shown (the firstREPORTED_ROWS: key, label, depth, whether it matches, whether a branch is open). Thetreesdebug collector ofViewsPlugin. - fold
- A character as the filter compares it: lower case, a Latin letter without its accent. One character for one, so that positions in the folded text are positions in the text.