Keep does nothing if an empty regex is entered (rather than crashing)
This commit is contained in:
parent
cf6c07d37d
commit
29ab42149c
|
@ -542,6 +542,8 @@ void keep(Context& context, int)
|
||||||
{
|
{
|
||||||
constexpr const char* prompt = matching ? "keep matching:" : "keep not matching:";
|
constexpr const char* prompt = matching ? "keep matching:" : "keep not matching:";
|
||||||
regex_prompt(context, prompt, [](const Regex& ex, Context& context) {
|
regex_prompt(context, prompt, [](const Regex& ex, Context& context) {
|
||||||
|
if (ex.empty())
|
||||||
|
return;
|
||||||
Editor& editor = context.editor();
|
Editor& editor = context.editor();
|
||||||
const Buffer& buffer = context.buffer();
|
const Buffer& buffer = context.buffer();
|
||||||
SelectionList keep;
|
SelectionList keep;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user