diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index e869446e..a5203352 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1760,6 +1760,8 @@ fn search_selection(cx: &mut Context) { .selection(view.id) .iter() .map(|selection| regex::escape(&selection.fragment(contents))) + .collect::>() // Collect into hashset to deduplicate identical regexes + .into_iter() .collect::>() .join("|");