summaryrefslogtreecommitdiff
path: root/src/normal.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-11-22 14:16:08 +0000
committerBram Moolenaar <Bram@vim.org>2021-11-22 14:16:08 +0000
commit2228cd72cf7c6f326e4e41179e88d37595ca4abc (patch)
tree22f89d7522a93d3cc7fcf58720811b07da23f023 /src/normal.c
parenta3f83feb63eae5464a620ae793c002eb45f7a838 (diff)
downloadvim-git-2228cd72cf7c6f326e4e41179e88d37595ca4abc.tar.gz
patch 8.2.3644: count for 'operatorfunc' in Visual mode is not redonev8.2.3644
Problem: Count for 'operatorfunc' in Visual mode is not redone. Solution: Add the count to the redo buffer. (closes #9174)
Diffstat (limited to 'src/normal.c')
-rw-r--r--src/normal.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/normal.c b/src/normal.c
index aab336a5f..56fae51da 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -380,8 +380,10 @@ static const struct nv_cmd
// Number of commands in nv_cmds[].
#define NV_CMDS_SIZE ARRAY_LENGTH(nv_cmds)
+#ifndef PROTO // cproto doesn't like this
// Sorted index of commands in nv_cmds[].
static short nv_cmd_idx[NV_CMDS_SIZE];
+#endif
// The highest index for which
// nv_cmds[idx].cmd_char == nv_cmd_idx[nv_cmds[idx].cmd_char]
@@ -1697,19 +1699,37 @@ prep_redo(
int cmd4,
int cmd5)
{
+ prep_redo_num2(regname, num, cmd1, cmd2, 0L, cmd3, cmd4, cmd5);
+}
+
+/*
+ * Prepare for redo of any command with extra count after "cmd2".
+ */
+ void
+prep_redo_num2(
+ int regname,
+ long num1,
+ int cmd1,
+ int cmd2,
+ long num2,
+ int cmd3,
+ int cmd4,
+ int cmd5)
+{
ResetRedobuff();
if (regname != 0) // yank from specified buffer
{
AppendCharToRedobuff('"');
AppendCharToRedobuff(regname);
}
- if (num)
- AppendNumberToRedobuff(num);
-
+ if (num1 != 0)
+ AppendNumberToRedobuff(num1);
if (cmd1 != NUL)
AppendCharToRedobuff(cmd1);
if (cmd2 != NUL)
AppendCharToRedobuff(cmd2);
+ if (num2 != 0)
+ AppendNumberToRedobuff(num2);
if (cmd3 != NUL)
AppendCharToRedobuff(cmd3);
if (cmd4 != NUL)