uniquify selection contents before generating regex for '*'
Avoid generating regex with the same alternative repeated multiple times.
This commit is contained in:
parent
89cd3c52eb
commit
26d14d52bb
|
@ -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 : '/');
|
||||
|
|
Loading…
Reference in New Issue
Block a user