aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-11-09 22:10:04 +0100
committerMarc André Tanner <mat@brain-dump.org>2016-11-09 22:10:04 +0100
commitfb34fb3be684499438df977f66b108e8fb2e816f (patch)
treebad0416e723350f29e77c100fbda4c3d325e2a5d /main.c
parent9fdf0e6cecda81daf4ed02ab9988690de73badd5 (diff)
downloadvis-fb34fb3be684499438df977f66b108e8fb2e816f.tar.gz
vis-fb34fb3be684499438df977f66b108e8fb2e816f.tar.xz
vis: handle cancelation of `r` command
Do not alter the text if <Escape> is pressed instead of a regular replacement character.
Diffstat (limited to 'main.c')
-rw-r--r--main.c3
1 files changed, 3 insertions, 0 deletions
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("<Escape>", 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);