@@ -286,8 +286,6 @@ pub struct Picker<T: Item> {
286
286
matcher : Box < Matcher > ,
287
287
/// (index, score)
288
288
matches : Vec < ( usize , i64 ) > ,
289
- /// Filter over original options.
290
- filters : Vec < usize > , // could be optimized into bit but not worth it now
291
289
292
290
/// Current height of the completions box
293
291
completion_height : u16 ,
@@ -322,7 +320,6 @@ impl<T: Item> Picker<T> {
322
320
editor_data,
323
321
matcher : Box :: new ( Matcher :: default ( ) ) ,
324
322
matches : Vec :: new ( ) ,
325
- filters : Vec :: new ( ) ,
326
323
cursor : 0 ,
327
324
prompt,
328
325
previous_pattern : String :: new ( ) ,
@@ -391,13 +388,6 @@ impl<T: Item> Picker<T> {
391
388
. iter ( )
392
389
. enumerate ( )
393
390
. filter_map ( |( index, option) | {
394
- // filter options first before matching
395
- if !self . filters . is_empty ( ) {
396
- // TODO: this filters functionality seems inefficient,
397
- // instead store and operate on filters if any
398
- self . filters . binary_search ( & index) . ok ( ) ?;
399
- }
400
-
401
391
let text = option. filter_text ( & self . editor_data ) ;
402
392
403
393
query
@@ -461,14 +451,6 @@ impl<T: Item> Picker<T> {
461
451
. map ( |( index, _score) | & self . options [ * index] )
462
452
}
463
453
464
- pub fn save_filter ( & mut self , cx : & Context ) {
465
- self . filters . clear ( ) ;
466
- self . filters
467
- . extend ( self . matches . iter ( ) . map ( |( index, _) | * index) ) ;
468
- self . filters . sort_unstable ( ) ; // used for binary search later
469
- self . prompt . clear ( cx. editor ) ;
470
- }
471
-
472
454
pub fn toggle_preview ( & mut self ) {
473
455
self . show_preview = !self . show_preview ;
474
456
}
@@ -546,9 +528,6 @@ impl<T: Item + 'static> Component for Picker<T> {
546
528
}
547
529
return close_fn;
548
530
}
549
- ctrl ! ( ' ' ) => {
550
- self . save_filter ( cx) ;
551
- }
552
531
ctrl ! ( 't' ) => {
553
532
self . toggle_preview ( ) ;
554
533
}
0 commit comments