diff --git a/src/normal.cc b/src/normal.cc index 7f2c9568..00474544 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -542,6 +542,8 @@ void keep(Context& context, int) { constexpr const char* prompt = matching ? "keep matching:" : "keep not matching:"; regex_prompt(context, prompt, [](const Regex& ex, Context& context) { + if (ex.empty()) + return; Editor& editor = context.editor(); const Buffer& buffer = context.buffer(); SelectionList keep;