search: fix empty search string, use previous pattern
This commit is contained in:
parent
c451dd07c6
commit
a83731c8e1
|
@ -143,7 +143,7 @@ void do_search(Context& context)
|
|||
{
|
||||
context.editor().select(selections);
|
||||
|
||||
if (str.empty() or event == PromptEvent::Abort)
|
||||
if (event == PromptEvent::Abort)
|
||||
return;
|
||||
|
||||
String ex = str;
|
||||
|
@ -155,7 +155,7 @@ void do_search(Context& context)
|
|||
RegisterManager::instance()['/'] = ex;
|
||||
context.push_jump();
|
||||
}
|
||||
else if (not context.options()["incsearch"].as_int())
|
||||
else if (ex.empty() or not context.options()["incsearch"].as_int())
|
||||
return;
|
||||
|
||||
context.editor().select(std::bind(select_next_match<forward>, _1, ex), mode);
|
||||
|
|
Loading…
Reference in New Issue
Block a user