diff options
| author | Maxime Coste <mawww@kakoune.org> | 2018-08-30 20:10:00 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2018-08-30 20:10:00 +1000 |
| commit | df655422d185980c859ea676f8ece15d2a56d493 (patch) | |
| tree | 39a55329bfa67efb073b808f734928540f5c0448 /src | |
| parent | ee39649d3a2a35812e3deaa231cffd0aed9258d7 (diff) | |
| parent | ede9155fc778de8153806815c5bc413c7e1bf142 (diff) | |
Merge remote-tracking branch 'Screwtapello/support-user-map-options'
Diffstat (limited to 'src')
| -rw-r--r-- | src/commands.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/commands.cc b/src/commands.cc index 59b7711f..990450cc 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -1448,7 +1448,8 @@ const CommandDesc declare_option_cmd = { " str-list: list of character strings\n" " completions: list of completion candidates\n" " line-specs: list of line specs\n" - " range-specs: list of range specs\n", + " range-specs: list of range specs\n" + " str-to-str-map: map from strings to strings\n", ParameterDesc{ { { "hidden", { false, "do not display option name when completing" } }, { "docstring", { true, "specify option description" } } }, @@ -1459,7 +1460,7 @@ const CommandDesc declare_option_cmd = { make_completer( [](const Context& context, CompletionFlags flags, const String& prefix, ByteCount cursor_pos) -> Completions { - auto c = {"int", "bool", "str", "regex", "int-list", "str-list", "completions", "line-specs", "range-specs"}; + auto c = {"int", "bool", "str", "regex", "int-list", "str-list", "completions", "line-specs", "range-specs", "str-to-str-map"}; return { 0_byte, cursor_pos, complete(prefix, cursor_pos, c) }; }), [](const ParametersParser& parser, Context& context, const ShellContext&) @@ -1492,6 +1493,8 @@ const CommandDesc declare_option_cmd = { opt = ®.declare_option<TimestampedList<LineAndSpec>>(parser[1], docstring, {}, flags); else if (parser[0] == "range-specs") opt = ®.declare_option<TimestampedList<RangeAndString>>(parser[1], docstring, {}, flags); + else if (parser[0] == "str-to-str-map") + opt = ®.declare_option<HashMap<String, String, MemoryDomain::Options>>(parser[1], docstring, {}, flags); else throw runtime_error(format("no such option type: '{}'", parser[0])); |
