From a83731c8e1a3c453bc6f0c6f6ffd73cc68fb8e70 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 19 Feb 2013 19:05:13 +0100 Subject: [PATCH] search: fix empty search string, use previous pattern --- src/main.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cc b/src/main.cc index cf1253c3..dcc18a68 100644 --- a/src/main.cc +++ b/src/main.cc @@ -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, _1, ex), mode);