diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-04-21 14:26:08 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-04-21 14:26:08 +0200 |
| commit | 78ae3873653e3a24a215df339da407ccef3003dd (patch) | |
| tree | 954d90c682776d5e5d1492a7d1c59181b8c6f910 /vis-cmds.c | |
| parent | 0480a61dbc68949cabb10ff40cb7d79df7c193b5 (diff) | |
| download | vis-78ae3873653e3a24a215df339da407ccef3003dd.tar.gz vis-78ae3873653e3a24a215df339da407ccef3003dd.tar.xz | |
vis: also show user registered :-commands in :help output
Diffstat (limited to 'vis-cmds.c')
| -rw-r--r-- | vis-cmds.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -546,9 +546,12 @@ static void print_mode(Mode *mode, Text *txt) { } static bool print_action(const char *key, void *value, void *data) { - Text *txt = data; KeyAction *action = value; - return text_appendf(txt, " %-30s\t%s\n", key, action->help); + return text_appendf(data, " %-30s\t%s\n", key, action->help); +} + +static bool print_cmd(const char *key, void *value, void *data) { + return text_appendf(data, " %s\n", key); } static void print_symbolic_keys(Vis *vis, Text *txt) { @@ -647,8 +650,7 @@ static bool cmd_help(Vis *vis, Win *win, Command *cmd, const char *argv[], Curso print_mode(&vis_modes[VIS_MODE_INSERT], txt); text_appendf(txt, "\n :-Commands\n\n"); - for (const CommandDef *cmd = cmds; cmd && cmd->name[0]; cmd++) - text_appendf(txt, " %s\n", cmd->name[0]); + map_iterate(vis->cmds, print_cmd, txt); text_appendf(txt, "\n Key binding actions\n\n"); map_iterate(vis->actions, print_action, txt); |
