support count in search next, and only push jump in replace mode

This commit is contained in:
Maxime Coste 2012-12-31 13:42:59 +01:00
parent 6d93552fbc
commit fe363094cf

View File

@ -177,8 +177,12 @@ void do_search_next(Context& context)
const String& ex = RegisterManager::instance()['/'].values(context)[0]; const String& ex = RegisterManager::instance()['/'].values(context)[0];
if (not ex.empty()) if (not ex.empty())
{ {
if (mode == SelectMode::Replace)
context.push_jump(); context.push_jump();
int count = context.numeric_param();
do {
context.editor().select(std::bind(select_next_match, _1, ex), mode); context.editor().select(std::bind(select_next_match, _1, ex), mode);
} while (--count > 0);
} }
else else
context.print_status("no search pattern"); context.print_status("no search pattern");