aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/getchar.c8
-rw-r--r--src/nvim/ops.c6
2 files changed, 11 insertions, 3 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index c070e53089..ca555937ab 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -92,8 +92,8 @@ static buffheader_T readbuf2 = { { NULL, { NUL } }, NULL, 0, 0 };
static int typeahead_char = 0; // typeahead char that's not flushed
-// when block_redo is true redo buffer will not be changed
-// used by edit() to repeat insertions and 'V' command for redoing
+/// When block_redo is true the redo buffer will not be changed.
+/// Used by edit() to repeat insertions.
static int block_redo = false;
static int KeyNoremap = 0; // remapping flags
@@ -558,6 +558,10 @@ void AppendToRedobuffLit(const char *str, int len)
/// and escaping other K_SPECIAL bytes.
void AppendToRedobuffSpec(const char *s)
{
+ if (block_redo) {
+ return;
+ }
+
while (*s != NUL) {
if ((uint8_t)(*s) == K_SPECIAL && s[1] != NUL && s[2] != NUL) {
// Insert special key literally.
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index ef26d5900d..c1511ab8da 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -5858,7 +5858,11 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank)
if (repeat_cmdline == NULL) {
ResetRedobuff();
} else {
- AppendToRedobuffSpec(repeat_cmdline);
+ if (cap->cmdchar == ':') {
+ AppendToRedobuffLit(repeat_cmdline, -1);
+ } else {
+ AppendToRedobuffSpec(repeat_cmdline);
+ }
AppendToRedobuff(NL_STR);
XFREE_CLEAR(repeat_cmdline);
}