From f08966197eaf0ca5f5012d6ec8378815bd1f32ec Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 23 May 2014 20:27:35 +0100 Subject: [PATCH] Change # register to contain selection number Using # in insert will allow easy numbering --- src/main.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.cc b/src/main.cc index a48051ae..a1d924ee 100644 --- a/src/main.cc +++ b/src/main.cc @@ -163,7 +163,12 @@ void register_registers() } dyn_regs[] = { { '%', [](const Context& context) { return StringList{{context.buffer().display_name()}}; } }, { '.', [](const Context& context) { return context.selections_content(); } }, - { '#', [](const Context& context) { return StringList{{to_string((int)context.selections().size())}}; } }, + { '#', [](const Context& context) { + StringList res; + for (size_t i = 1; i < context.selections().size(); ++i) + res.push_back(to_string((int)i)); + return res; + } } }; RegisterManager& register_manager = RegisterManager::instance();