summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2016-10-04 13:18:03 +0100
committerMaxime Coste <frrrwww@gmail.com>2016-10-04 13:18:03 +0100
commit620fc28ea60139ddfbc4e8b9675c43e3a1ad711a (patch)
treec70da83ee3739f071393eda1b92da925ea480b27 /src
parent8a4cf85e22968e7ae77f0fa445836f575782696e (diff)
Add "(extend)" to search prompts when we are extending the selection
Fixes #832
Diffstat (limited to 'src')
-rw-r--r--src/normal.cc6
1 files changed, 5 insertions, 1 deletions
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<SelectMode mode, Direction direction>
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)};