From fe363094cf924692c491304169f823bd27ff3673 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 31 Dec 2012 13:42:59 +0100 Subject: [PATCH] support count in search next, and only push jump in replace mode --- src/main.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.cc b/src/main.cc index 1e6619d7..26ad5ba3 100644 --- a/src/main.cc +++ b/src/main.cc @@ -177,8 +177,12 @@ void do_search_next(Context& context) const String& ex = RegisterManager::instance()['/'].values(context)[0]; if (not ex.empty()) { - context.push_jump(); - context.editor().select(std::bind(select_next_match, _1, ex), mode); + if (mode == SelectMode::Replace) + context.push_jump(); + int count = context.numeric_param(); + do { + context.editor().select(std::bind(select_next_match, _1, ex), mode); + } while (--count > 0); } else context.print_status("no search pattern");