vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 809579eb987a2da71da3ad21ddf1c6833be52526
parent 383fa482aed9945da7e12b66016ce11db870b578
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Fri, 10 Feb 2017 18:45:21 +0100

vis: make t, T, f and F work for special keys

Fix #491

Diffstat:
Mmain.c | 14+++++---------
1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/main.c b/main.c @@ -1721,16 +1721,12 @@ static const char *movement_key(Vis *vis, const char *keys, const Arg *arg) { return NULL; } - char key[32]; - const char *next; - if (!(next = vis_keys_next(vis, keys))) + const char *next = vis_keys_next(vis, keys); + if (!next) return NULL; - size_t len = next - keys; - if (len < sizeof key) { - strncpy(key, keys, len); - key[len] = '\0'; - vis_motion(vis, arg->i, key); - } + char utf8[UTFmax+1]; + if (vis_keys_utf8(vis, keys, utf8)) + vis_motion(vis, arg->i, utf8); return next; }