diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-02-19 19:05:13 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-02-19 19:05:13 +0100 |
| commit | a83731c8e1a3c453bc6f0c6f6ffd73cc68fb8e70 (patch) | |
| tree | 8b7ee244128ca86f1d7cb86762f00e56ee57c39c /src | |
| parent | c451dd07c62d025808f9e2023779bb4dbad15d8c (diff) | |
search: fix empty search string, use previous pattern
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.cc | 4 |
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); |
