diff options
| author | Maxime Coste <mawww@kakoune.org> | 2022-06-30 16:36:12 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2022-06-30 16:39:18 +1000 |
| commit | d87ee212bac837f59d62598391b4264db80d4b36 (patch) | |
| tree | ddcc61ebcd07db11492adea03ed160d5996b0888 /src/input_handler.cc | |
| parent | 6565f6edd700a1490c670f4e60cd52f7f78dbbe5 (diff) | |
Insert all register values in prompt after <c-r> when Alt-modified
`<c-r><a-.>` will insert all selections joined by space instead of only
the main one as `<c-r>.` would.
Diffstat (limited to 'src/input_handler.cc')
| -rw-r--r-- | src/input_handler.cc | 9 |
1 files changed, 7 insertions, 2 deletions
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; |
