From b1735ae76ed730698c9b25b9534a96c625f52b03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Ros=C3=A9n?= Date: Thu, 25 May 2017 21:39:05 +0200 Subject: [PATCH] Expose last entered command in register : --- src/input_handler.cc | 3 ++- src/main.cc | 2 +- src/normal.cc | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/input_handler.cc b/src/input_handler.cc index 9a4d8c83..18da32d7 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 1dc5bf16..5bd1afe5 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 6b2b568a..aa2c3903 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} }