diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-10-23 21:09:44 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-10-25 22:46:43 +0100 |
| commit | cdd1b1a38b9f4c531d22c791b9c157450fd05a7e (patch) | |
| tree | a1b0e46c04bdd1b87652420f49915ad1d3fc4d05 | |
| parent | 329f41609621f29ac6b58dcc33cd41bf437c02c7 (diff) | |
| download | vis-cdd1b1a38b9f4c531d22c791b9c157450fd05a7e.tar.gz vis-cdd1b1a38b9f4c531d22c791b9c157450fd05a7e.tar.xz | |
vis: introduce vis_cmd API
| -rw-r--r-- | vis.c | 8 | ||||
| -rw-r--r-- | vis.h | 2 |
2 files changed, 6 insertions, 4 deletions
@@ -1156,7 +1156,7 @@ static const char *quit(Vis *vis, const char *keys, const Arg *arg) { } static const char *cmd(Vis *vis, const char *keys, const Arg *arg) { - exec_command(vis, ':', arg->s); + vis_cmd(vis, arg->s); return keys; } @@ -2297,7 +2297,7 @@ static Command *lookup_cmd(Vis *vis, const char *name) { return map_closest(vis->cmds, name); } -static bool exec_cmdline_command(Vis *vis, const char *cmdline) { +bool vis_cmd(Vis *vis, const char *cmdline) { enum CmdOpt opt = CMD_OPT_NONE; size_t len = strlen(cmdline); char *line = malloc(len+2); @@ -2391,7 +2391,7 @@ static bool exec_command(Vis *vis, char type, const char *cmd) { return true; case '+': case ':': - if (exec_cmdline_command(vis, cmd)) + if (vis_cmd(vis, cmd)) return true; } return false; @@ -2399,7 +2399,7 @@ static bool exec_command(Vis *vis, char type, const char *cmd) { static void settings_apply(Vis *vis, const char **settings) { for (const char **opt = settings; opt && *opt; opt++) - exec_cmdline_command(vis, *opt); + vis_cmd(vis, *opt); } static bool vis_window_new(Vis *vis, const char *file) { @@ -137,6 +137,8 @@ enum VisTextObject { void vis_textobject(Vis*, enum VisTextObject); +bool vis_cmd(Vis*, const char *cmdline); + bool vis_signal_handler(Vis*, int signum, const siginfo_t *siginfo, const void *context); |
