From 620fc28ea60139ddfbc4e8b9675c43e3a1ad711a Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 4 Oct 2016 13:18:03 +0100 Subject: [PATCH] Add "(extend)" to search prompts when we are extending the selection Fixes #832 --- src/normal.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/normal.cc b/src/normal.cc index 60afe80d..a5dd988d 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -643,9 +643,13 @@ void regex_prompt(Context& context, String prompt, T func) template void search(Context& context, NormalParams params) { + constexpr StringView prompt = mode == SelectMode::Extend ? + (direction == Forward ? "search (extend):" : "reverse search (extend):") + : (direction == Forward ? "search:" : "reverse search:"); + const char reg = to_lower(params.reg ? params.reg : '/'); int count = params.count; - regex_prompt(context, direction == Forward ? "search:" : "reverse search:", + regex_prompt(context, prompt.str(), [reg, count](Regex ex, PromptEvent event, Context& context) { if (ex.empty()) ex = Regex{context.main_sel_register_value(reg)};