Skip to content

Commit 5f998ed

Browse files
authored
fix: vortex-tui browse with search (#5282)
1 parent c4240f1 commit 5f998ed

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

vortex-tui/src/browse/ui/layouts.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -237,25 +237,22 @@ fn render_children_list(app: &mut AppState, area: Rect, buf: &mut Buffer) {
237237
// Use fuzzy matching to rank and filter results
238238
let matcher = SkimMatcherV2::default();
239239

240-
// Collect scored matches
241-
let mut scored_matches = layout
240+
// Collect matches
241+
let matches = layout
242242
.child_names()
243243
.enumerate()
244244
.filter_map(|(idx, name)| {
245245
matcher
246246
.fuzzy_match(&name, &search_filter)
247-
.map(|score| (idx, name.to_string(), score))
247+
.map(|_| (idx, name.to_string()))
248248
})
249249
.collect_vec();
250250

251-
// Sort by score (higher is better)
252-
scored_matches.sort_by(|a, b| b.2.cmp(&a.2));
253-
254251
// Create filter based on fuzzy matches
255252
let mut filter = vec![false; layout.nchildren()];
256-
let list_items = scored_matches
253+
let list_items = matches
257254
.iter()
258-
.map(|(idx, name, _score)| {
255+
.map(|(idx, name)| {
259256
filter[*idx] = true;
260257
name.clone()
261258
})

0 commit comments

Comments
 (0)