From a599a60c543d38c6b803702d2fc991e3d7ab0b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 16 Nov 2016 23:42:26 +0100 Subject: vis: treat vis_keys_feed input like a macro replay We need to push keys individually to the input queue such that the state machine can advance and record keys into the operator macro if necessary. Previously feeding the following input: isome text. would not work as expected because the complete key stream was pushed to the input queue at the same time during which the operator macro was not yet active. Thus the dot command at the end would have nothing to repeat. --- vis.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'vis.c') diff --git a/vis.c b/vis.c index e3ad87e..ed94f7d 100644 --- a/vis.c +++ b/vis.c @@ -930,7 +930,14 @@ static void vis_keys_process(Vis *vis, size_t pos) { } void vis_keys_feed(Vis *vis, const char *input) { - vis_keys_push(vis, input, buffer_length0(vis->keys), false); + if (!input) + return; + Macro macro; + macro_init(¯o); + if (!macro_append(¯o, input)) + return; + macro_replay(vis, ¯o); + macro_release(¯o); } static void vis_keys_push(Vis *vis, const char *input, size_t pos, bool record) { -- cgit v1.2.3