@@ -310,8 +310,6 @@ pub struct Picker<T: Item> {
310 matcher: Box<Matcher>,
310 matcher: Box<Matcher>,
311 /// (index, score)
311 /// (index, score)
312 matches: Vec<(usize, i64)>,
312 matches: Vec<(usize, i64)>,
313− /// Filter over original options.
314− filters: Vec<usize>, // could be optimized into bit but not worth it now
316 /// Current height of the completions box
314 /// Current height of the completions box
317 completion_height: u16,
315 completion_height: u16,
@@ -346,7 +344,6 @@ impl<T: Item> Picker<T> {
346 editor_data,
344 editor_data,
347 matcher: Box::new(Matcher::default()),
345 matcher: Box::new(Matcher::default()),
348 matches: Vec::new(),
346 matches: Vec::new(),
349− filters: Vec::new(),
350 cursor: 0,
347 cursor: 0,
352 previous_pattern: String::new(),
349 previous_pattern: String::new(),
@@ -415,13 +412,6 @@ impl<T: Item> Picker<T> {
416 .enumerate()
413 .enumerate()
417 .filter_map(|(index, option)| {
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()?;
425 let text = option.filter_text(&self.editor_data);
415 let text = option.filter_text(&self.editor_data);
@@ -485,14 +475,6 @@ impl<T: Item> Picker<T> {
485 .map(|(index, _score)| &self.options[*index])
475 .map(|(index, _score)| &self.options[*index])
488− pub fn save_filter(&mut self, cx: &Context) {
489− self.filters.clear();
491− .extend(self.matches.iter().map(|(index, _)| *index));
492− self.filters.sort_unstable(); // used for binary search later
493− self.prompt.clear(cx.editor);
496 pub fn toggle_preview(&mut self) {
478 pub fn toggle_preview(&mut self) {
497 self.show_preview = !self.show_preview;
479 self.show_preview = !self.show_preview;
@@ -573,9 +555,6 @@ impl<T: Item + 'static> Component for Picker<T> {
574 return close_fn;
556 return close_fn;
577− self.save_filter(cx);
579 ctrl!('t') => {
558 ctrl!('t') => {
580 self.toggle_preview();
559 self.toggle_preview();