summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-02-19 19:05:13 +0100
committerMaxime Coste <frrrwww@gmail.com>2013-02-19 19:05:13 +0100
commita83731c8e1a3c453bc6f0c6f6ffd73cc68fb8e70 (patch)
tree8b7ee244128ca86f1d7cb86762f00e56ee57c39c /src
parentc451dd07c62d025808f9e2023779bb4dbad15d8c (diff)
search: fix empty search string, use previous pattern
Diffstat (limited to 'src')
-rw-r--r--src/main.cc4
1 files 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<forward>, _1, ex), mode);