diff --git a/doc/pages/keys.asciidoc b/doc/pages/keys.asciidoc index e26d6925..d5807d79 100644 --- a/doc/pages/keys.asciidoc +++ b/doc/pages/keys.asciidoc @@ -798,7 +798,9 @@ The following keys are recognized by this mode to help with editing select previous completion candidate **:: - insert then content of the register given by next key + insert then content of the register given by next key, if next key + has the Alt modifier, it will insert all values in the register + joined with spaces, else it will insert the main one **:: insert next keystroke without interpreting it diff --git a/src/input_handler.cc b/src/input_handler.cc index ec8ff3b4..9fab9ccd 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -826,11 +826,16 @@ public: { on_next_key_with_autoinfo(context(), "register", KeymapMode::None, [this](Key key, Context&) { + const bool joined = (bool)(key.modifiers & Key::Modifiers::Alt); + key.modifiers &= ~Key::Modifiers::Alt; + auto cp = key.codepoint(); if (not cp or key == Key::Escape) return; - StringView reg = context().main_sel_register_value(String{*cp}); - m_line_editor.insert(reg); + + m_line_editor.insert( + joined ? join(RegisterManager::instance()[*cp].get(context()), ' ', false) + : context().main_sel_register_value(String{*cp})); display(); m_line_changed = true;