diff options
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r-- | helix-term/src/commands.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index ee9bad98..aae9979d 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -3933,15 +3933,12 @@ pub fn completion(cx: &mut Context) { }; if !prefix.is_empty() { - items = items - .into_iter() - .filter(|item| { - item.filter_text - .as_ref() - .unwrap_or(&item.label) - .starts_with(&prefix) - }) - .collect(); + items.retain(|item| { + item.filter_text + .as_ref() + .unwrap_or(&item.label) + .starts_with(&prefix) + }); } if items.is_empty() { |