Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/default_expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ pub enum DefaultExpand<'a> {
/// and array elements, that match the search term. Letter case is ignored. The matches are highlighted.
/// If the search term is empty, nothing will be expanded by default.
SearchResults(&'a str),
/// Similar to `SearchResults`, but expands all arrays and objects if the search term is empty.
SearchResultsOrAll(&'a str),
}
4 changes: 3 additions & 1 deletion src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ impl<'a, 'b, T: ToJsonTreeValue> JsonTreeNode<'a, 'b, T> {
DefaultExpand::All => (InnerExpand::All, None),
DefaultExpand::None => (InnerExpand::None, None),
DefaultExpand::ToLevel(l) => (InnerExpand::ToLevel(l), None),
DefaultExpand::SearchResults(search_str) => {
DefaultExpand::SearchResultsOrAll("") => (InnerExpand::All, None),
DefaultExpand::SearchResults(search_str)
| DefaultExpand::SearchResultsOrAll(search_str) => {
let search_term = SearchTerm::parse(search_str);
let search_match_path_ids = search_term
.as_ref()
Expand Down