summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2022-08-05 20:10:11 +1000
committerMaxime Coste <mawww@kakoune.org>2022-08-05 20:10:11 +1000
commit26d14d52bb922ccdf896fd1dae392f6cbbbb132e (patch)
tree3c84995421ac43294d909d29e34e6a29d56d9bd1 /src
parent89cd3c52eb8484f9d03f80a3372625da07284966 (diff)
uniquify selection contents before generating regex for '*'
Avoid generating regex with the same alternative repeated multiple times.
Diffstat (limited to 'src')
-rw-r--r--src/normal.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/normal.cc b/src/normal.cc
index 68a5fd6f..c310817d 100644
--- a/src/normal.cc
+++ b/src/normal.cc
@@ -983,7 +983,7 @@ void use_selection_as_search_pattern(Context& context, NormalParams params)
smart and is_bow(buffer, beg) ? "\\b" : "",
escape(buffer.string(beg, end), "^$\\.*+?()[]{}|", '\\'),
smart and is_eow(buffer, end) ? "\\b" : "");
- });
+ }) | gather<HashSet>();
String pattern = join(patterns, '|', false);
const char reg = to_lower(params.reg ? params.reg : '/');