From 1a87cbd5082f410aee362a274edcc817bfb9f34a Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Sat, 1 Oct 2022 19:35:49 +0200 Subject: remove filterting with C-space from picker --- helix-term/src/ui/picker.rs | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'helix-term/src/ui') diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index ac97e3cc..c7149c61 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -310,8 +310,6 @@ pub struct Picker { matcher: Box, /// (index, score) matches: Vec<(usize, i64)>, - /// Filter over original options. - filters: Vec, // could be optimized into bit but not worth it now /// Current height of the completions box completion_height: u16, @@ -346,7 +344,6 @@ impl Picker { editor_data, matcher: Box::new(Matcher::default()), matches: Vec::new(), - filters: Vec::new(), cursor: 0, prompt, previous_pattern: String::new(), @@ -415,13 +412,6 @@ impl Picker { .iter() .enumerate() .filter_map(|(index, option)| { - // filter options first before matching - if !self.filters.is_empty() { - // TODO: this filters functionality seems inefficient, - // instead store and operate on filters if any - self.filters.binary_search(&index).ok()?; - } - let text = option.filter_text(&self.editor_data); query @@ -485,14 +475,6 @@ impl Picker { .map(|(index, _score)| &self.options[*index]) } - pub fn save_filter(&mut self, cx: &Context) { - self.filters.clear(); - self.filters - .extend(self.matches.iter().map(|(index, _)| *index)); - self.filters.sort_unstable(); // used for binary search later - self.prompt.clear(cx.editor); - } - pub fn toggle_preview(&mut self) { self.show_preview = !self.show_preview; } @@ -573,9 +555,6 @@ impl Component for Picker { } return close_fn; } - ctrl!(' ') => { - self.save_filter(cx); - } ctrl!('t') => { self.toggle_preview(); } -- cgit v1.2.3-70-g09d2