diff options
author | A-Walrus | 2022-09-22 15:33:30 +0000 |
---|---|---|
committer | GitHub | 2022-09-22 15:33:30 +0000 |
commit | eb6fd283dcf041ecf822fd8f2d4520abb2a26df9 (patch) | |
tree | 4f2d831b20735c8022724be5197688cff07af06c /helix-term/src | |
parent | e621848d075c1751ab2be6f3a82ac67490ec7909 (diff) |
Deduplicate regexes in search_selection command (#3941)
Diffstat (limited to 'helix-term/src')
-rw-r--r-- | helix-term/src/commands.rs | 2 |
1 files changed, 2 insertions, 0 deletions
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::<HashSet<_>>() // Collect into hashset to deduplicate identical regexes + .into_iter() .collect::<Vec<_>>() .join("|"); |