diff --git a/src/normal.cc b/src/normal.cc index 57581d53..13cd27da 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -450,7 +450,11 @@ void command(Context& context, NormalParams params) } if (event == PromptEvent::Validate) { - RegisterManager::instance()[':'].set(context, cmdline.str()); + if (cmdline.empty()) + cmdline = context.main_sel_register_value(':'); + else + RegisterManager::instance()[':'].set(context, cmdline.str()); + EnvVarMap env_vars = { { "count", to_string(params.count) }, { "register", String{¶ms.reg, 1} }