From eb6fd283dcf041ecf822fd8f2d4520abb2a26df9 Mon Sep 17 00:00:00 2001 From: A-Walrus Date: Thu, 22 Sep 2022 18:33:30 +0300 Subject: Deduplicate regexes in search_selection command (#3941) --- helix-term/src/commands.rs | 2 ++ 1 file changed, 2 insertions(+) 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("|"); -- cgit v1.2.3-70-g09d2