irongit

feat: multiple queries in filter separated by |

huncholanehuncholaneauthored
parent 9dc3fcecommit eeae321df9a65615174ef34ed6a0beefeddf8feaBrowse files

1 file changed, +6 -1

+6-1src/widgets/miller.rs
@@ -203,11 +203,16 @@ impl MillerFilter {
203203 }
204204
205205 /// Fuzzy match a label against the query. Returns true if it matches (or query is empty).
206+ /// Supports `|` to OR multiple terms (e.g. "start|report" matches either).
206207 pub fn matches(&self, label: &str) -> bool {
207208 if self.query.is_empty() {
208209 return true;
209210 }
210- fuzzy_matches(&self.query, label)
211+ self.query.split('|')
212+ .any(|term| {
213+ let term = term.trim();
214+ !term.is_empty() && fuzzy_matches(term, label)
215+ })
211216 }
212217
213218 /// Filter a list of labels and manage selection mapping.