From 5958d1e993298920deb02bf61eeb351ca768e3e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 25 Oct 2015 22:49:48 +0100 Subject: vis: introduce vis_key_next API --- vis.c | 9 ++++----- vis.h | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vis.c b/vis.c index 6acc55b..6916947 100644 --- a/vis.c +++ b/vis.c @@ -363,7 +363,6 @@ static bool vis_window_split(Win *win); #include "config.h" static const char *getkey(Vis*); -static const char *keynext(Vis*, const char *keys); static void action_do(Vis*, Action *a); static bool exec_command(Vis *vis, char type, const char *cmdline); @@ -877,7 +876,7 @@ static const char *cursors_remove(Vis *vis, const char *keys, const Arg *arg) { static const char *replace(Vis *vis, const char *keys, const Arg *arg) { if (!keys[0]) return NULL; - const char *next = keynext(vis, keys); + const char *next = vis_key_next(vis, keys); size_t len = next - keys; action_reset(vis, &vis->action_prev); vis->action_prev.op = &ops[OP_REPEAT_REPLACE]; @@ -928,7 +927,7 @@ static const char *movement_key(Vis *vis, const char *keys, const Arg *arg) { if (!keys[0]) return NULL; char key[32]; - const char *next = keynext(vis, keys); + const char *next = vis_key_next(vis, keys); strncpy(key, keys, next - keys + 1); key[sizeof(key)-1] = '\0'; vis_motion(vis, arg->i, key); @@ -2460,7 +2459,7 @@ void vis_die(Vis *vis, const char *msg, ...) { va_end(ap); } -static const char *keynext(Vis *vis, const char *keys) { +const char *vis_key_next(Vis *vis, const char *keys) { TermKeyKey key; TermKey *termkey = vis->ui->termkey_get(vis->ui); const char *next = NULL; @@ -2493,7 +2492,7 @@ static const char *vis_keys_raw(Vis *vis, Buffer *buf, const char *input) { while (cur && *cur) { - if (!(end = (char*)keynext(vis, cur))) { + if (!(end = (char*)vis_key_next(vis, cur))) { // XXX: can't parse key this should never happen, throw away remaining input buffer_truncate(buf); return input + strlen(input); diff --git a/vis.h b/vis.h index c98b51b..6a3b710 100644 --- a/vis.h +++ b/vis.h @@ -180,6 +180,7 @@ void vis_repeat(Vis*); bool vis_cmd(Vis*, const char *cmdline); +const char *vis_key_next(Vis*, const char *keys); const char *vis_keys(Vis*, const char *input); bool vis_signal_handler(Vis*, int signum, const siginfo_t *siginfo, -- cgit v1.2.3