@@ -310,8 +310,6 @@ pub struct Picker<T: Item> {
310
310
matcher : Box < Matcher > ,
311
311
/// (index, score)
312
312
matches : Vec < ( usize , i64 ) > ,
313
- /// Filter over original options.
314
- filters : Vec < usize > , // could be optimized into bit but not worth it now
315
313
316
314
/// Current height of the completions box
317
315
completion_height : u16 ,
@@ -346,7 +344,6 @@ impl<T: Item> Picker<T> {
346
344
editor_data,
347
345
matcher : Box :: new ( Matcher :: default ( ) ) ,
348
346
matches : Vec :: new ( ) ,
349
- filters : Vec :: new ( ) ,
350
347
cursor : 0 ,
351
348
prompt,
352
349
previous_pattern : String :: new ( ) ,
@@ -415,13 +412,6 @@ impl<T: Item> Picker<T> {
415
412
. iter ( )
416
413
. enumerate ( )
417
414
. filter_map ( |( index, option) | {
418
- // filter options first before matching
419
- if !self . filters . is_empty ( ) {
420
- // TODO: this filters functionality seems inefficient,
421
- // instead store and operate on filters if any
422
- self . filters . binary_search ( & index) . ok ( ) ?;
423
- }
424
-
425
415
let text = option. filter_text ( & self . editor_data ) ;
426
416
427
417
query
@@ -485,14 +475,6 @@ impl<T: Item> Picker<T> {
485
475
. map ( |( index, _score) | & self . options [ * index] )
486
476
}
487
477
488
- pub fn save_filter ( & mut self , cx : & Context ) {
489
- self . filters . clear ( ) ;
490
- self . filters
491
- . extend ( self . matches . iter ( ) . map ( |( index, _) | * index) ) ;
492
- self . filters . sort_unstable ( ) ; // used for binary search later
493
- self . prompt . clear ( cx. editor ) ;
494
- }
495
-
496
478
pub fn toggle_preview ( & mut self ) {
497
479
self . show_preview = !self . show_preview ;
498
480
}
@@ -573,9 +555,6 @@ impl<T: Item + 'static> Component for Picker<T> {
573
555
}
574
556
return close_fn;
575
557
}
576
- ctrl ! ( ' ' ) => {
577
- self . save_filter ( cx) ;
578
- }
579
558
ctrl ! ( 't' ) => {
580
559
self . toggle_preview ( ) ;
581
560
}
0 commit comments