src: Let :set-register
complete register names
This commit allows the `set-register` command to suggest candidates named after punctuated registers, similarly to %reg{…} expansions.
This commit is contained in:
parent
e9cf0f23f2
commit
c0cb5db6a4
|
@ -2365,7 +2365,12 @@ const CommandDesc set_register_cmd = {
|
|||
ParameterDesc{{}, ParameterDesc::Flags::SwitchesAsPositional, 1},
|
||||
CommandFlags::None,
|
||||
CommandHelper{},
|
||||
CommandCompleter{},
|
||||
make_completer(
|
||||
[](const Context& context, CompletionFlags flags,
|
||||
const String& prefix, ByteCount cursor_pos) -> Completions {
|
||||
return { 0_byte, cursor_pos,
|
||||
RegisterManager::instance().complete_register_name(prefix, cursor_pos) };
|
||||
}),
|
||||
[](const ParametersParser& parser, Context& context, const ShellContext&)
|
||||
{
|
||||
RegisterManager::instance()[parser[0]].set(context, parser.positionals_from(1));
|
||||
|
|
Loading…
Reference in New Issue
Block a user