diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-11-09 22:10:04 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-11-09 22:10:04 +0100 |
| commit | fb34fb3be684499438df977f66b108e8fb2e816f (patch) | |
| tree | bad0416e723350f29e77c100fbda4c3d325e2a5d /main.c | |
| parent | 9fdf0e6cecda81daf4ed02ab9988690de73badd5 (diff) | |
| download | vis-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.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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); |
