Skip to content

Commit 47ab515

Browse files
committed
remove filterting with C-space from picker
1 parent 7235f31 commit 47ab515

File tree

2 files changed

+0
-22
lines changed

2 files changed

+0
-22
lines changed

book/src/keymap.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,6 @@ Keys to use within picker. Remapping currently not supported.
376376
| `PageDown`, `Ctrl-d` | Page down |
377377
| `Home` | Go to first entry |
378378
| `End` | Go to last entry |
379-
| `Ctrl-space` | Filter options |
380379
| `Enter` | Open selected |
381380
| `Ctrl-s` | Open horizontally |
382381
| `Ctrl-v` | Open vertically |

helix-term/src/ui/picker.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,6 @@ pub struct Picker<T: Item> {
286286
matcher: Box<Matcher>,
287287
/// (index, score)
288288
matches: Vec<(usize, i64)>,
289-
/// Filter over original options.
290-
filters: Vec<usize>, // could be optimized into bit but not worth it now
291289

292290
/// Current height of the completions box
293291
completion_height: u16,
@@ -322,7 +320,6 @@ impl<T: Item> Picker<T> {
322320
editor_data,
323321
matcher: Box::new(Matcher::default()),
324322
matches: Vec::new(),
325-
filters: Vec::new(),
326323
cursor: 0,
327324
prompt,
328325
previous_pattern: String::new(),
@@ -391,13 +388,6 @@ impl<T: Item> Picker<T> {
391388
.iter()
392389
.enumerate()
393390
.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-
401391
let text = option.filter_text(&self.editor_data);
402392

403393
query
@@ -461,14 +451,6 @@ impl<T: Item> Picker<T> {
461451
.map(|(index, _score)| &self.options[*index])
462452
}
463453

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-
472454
pub fn toggle_preview(&mut self) {
473455
self.show_preview = !self.show_preview;
474456
}
@@ -546,9 +528,6 @@ impl<T: Item + 'static> Component for Picker<T> {
546528
}
547529
return close_fn;
548530
}
549-
ctrl!(' ') => {
550-
self.save_filter(cx);
551-
}
552531
ctrl!('t') => {
553532
self.toggle_preview();
554533
}

0 commit comments

Comments
 (0)