diff --git a/src/input_handler.cc b/src/input_handler.cc index 9a4d8c839..18da32d79 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -149,7 +149,8 @@ constexpr StringView register_doc = " * @: default macro register\n" " * /: default search register\n" " * ^: default mark register\n" - " * |: default shell command register\n"; + " * |: default shell command register\n" + " * :: last entered command\n"; class Normal : public InputMode { diff --git a/src/main.cc b/src/main.cc index 1dc5bf164..5bd1afe5c 100644 --- a/src/main.cc +++ b/src/main.cc @@ -171,7 +171,7 @@ void register_registers() { RegisterManager& register_manager = RegisterManager::instance(); - for (auto c : "abcdefghijklmnopqrstuvwxyz/\"|^@") + for (auto c : "abcdefghijklmnopqrstuvwxyz/\"|^@:") register_manager.add_register(c, make_unique()); using StringList = Vector; diff --git a/src/normal.cc b/src/normal.cc index 6b2b568a2..aa2c39033 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -451,6 +451,7 @@ void command(Context& context, NormalParams params) } if (event == PromptEvent::Validate) { + RegisterManager::instance()[':'].set(context, cmdline.str()); EnvVarMap env_vars = { { "count", to_string(params.count) }, { "register", String{¶ms.reg, 1} }