vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit d5bdad63e8e9588b5b6dfb5cda3aaf8b010e764a parent a13111368a3f24d37be6d641eb7e1eb9544930fe Author: Marc André Tanner <mat@brain-dump.org> Date: Tue, 5 Apr 2016 20:39:33 +0200 vis: remove left over from :sam command Diffstat:
| M | sam.c | | | 8 | ++++---- |
| M | vis-core.h | | | 1 | - |
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/sam.c b/sam.c @@ -472,16 +472,16 @@ static void command_free(Command *cmd) { } static const CommandDef *command_lookup(Vis *vis, const char *name) { - if (!vis->sam_cmds) { - if (!(vis->sam_cmds = map_new())) + if (!vis->cmds) { + if (!(vis->cmds = map_new())) return NULL; for (const CommandDef *cmd = cmds; cmd && cmd->name[0]; cmd++) { for (const char *const *name = cmd->name; *name; name++) - map_put(vis->sam_cmds, *name, cmd); + map_put(vis->cmds, *name, cmd); } } - return map_closest(vis->sam_cmds, name); + return map_closest(vis->cmds, name); } static Command *command_parse(Vis *vis, const char **s, int level, enum SamError *err) { diff --git a/vis-core.h b/vis-core.h @@ -152,7 +152,6 @@ struct Vis { bool expandtab; /* whether typed tabs should be converted to spaces */ bool autoindent; /* whether indentation should be copied from previous line on newline */ Map *cmds; /* ":"-commands, used for unique prefix queries */ - Map *sam_cmds; /* ":"-commands, used for unique prefix queries */ Map *options; /* ":set"-options */ Map *keymap; /* key translation before any bindings are matched */ Buffer input_queue; /* holds pending input keys */