aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-05 16:40:01 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-07-05 17:32:42 +0800
commitdd5fce2f5df9d49fe9ca878190471ac6697b636c (patch)
treeb53844bb30503c63fe1ac3c9017ea01db092bd4d /src/nvim/normal.c
parentf42657cbcf0e5775692b57e25591d42844a81934 (diff)
downloadrneovim-dd5fce2f5df9d49fe9ca878190471ac6697b636c.tar.gz
rneovim-dd5fce2f5df9d49fe9ca878190471ac6697b636c.tar.bz2
rneovim-dd5fce2f5df9d49fe9ca878190471ac6697b636c.zip
vim-patch:8.2.3644: count for 'operatorfunc' in Visual mode is not redone
Problem: Count for 'operatorfunc' in Visual mode is not redone. Solution: Add the count to the redo buffer. (closes vim/vim#9174) https://github.com/vim/vim/commit/2228cd72cf7c6f326e4e41179e88d37595ca4abc Cherry-pick a line from patch 8.2.0522.
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index ae4372da89..ed624c0c9f 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -2494,21 +2494,30 @@ static void prep_redo_cmd(cmdarg_T *cap)
/// Note that only the last argument can be a multi-byte char.
void prep_redo(int regname, long num, int cmd1, int cmd2, int cmd3, 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);
}