diff options
| author | Maxime Coste <mawww@kakoune.org> | 2018-03-19 03:04:50 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2018-03-19 03:04:50 +1100 |
| commit | 9518f279fb34d444ebb9f26509dfb8ee2a1ddf14 (patch) | |
| tree | ac213505bda939fea56fff74dd13a77f29a2908d /src | |
| parent | 126dd11ba8e9e13b66c4c98721b08770c3faa232 (diff) | |
Tweak option documentation helper to support -add
Fixes #1939
Diffstat (limited to 'src')
| -rw-r--r-- | src/commands.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/commands.cc b/src/commands.cc index b6ba6b36..0f986498 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -1244,10 +1244,11 @@ const CommandDesc source_cmd = { static String option_doc_helper(const Context& context, CommandParameters params) { - if (params.size() < 2) + const bool add = params.size() > 1 and params[0] == "-add"; + if (params.size() < 2 + (add ? 1 : 0)) return ""; - auto desc = GlobalScope::instance().option_registry().option_desc(params[1]); + auto desc = GlobalScope::instance().option_registry().option_desc(params[1 + (add ? 1 : 0)]); if (not desc or desc->docstring().empty()) return ""; |
