From fb34fb3be684499438df977f66b108e8fb2e816f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 9 Nov 2016 22:10:04 +0100 Subject: vis: handle cancelation of `r` command Do not alter the text if is pressed instead of a regular replacement character. --- main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.c b/main.c index e439b30..3b3689b 100644 --- a/main.c +++ b/main.c @@ -1647,6 +1647,9 @@ static const char *replace(Vis *vis, const char *keys, const Arg *arg) { memcpy(replacement, keys, len); replacement[len] = '\0'; + if (strcmp("", replacement) == 0) + return next; + if (vis_mode_get(vis) == VIS_MODE_NORMAL) { int count = vis_count_get_default(vis, 1); vis_operator(vis, VIS_OP_CHANGE); -- cgit v1.2.3