diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-07-05 16:40:01 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-07-05 17:32:42 +0800 |
commit | dd5fce2f5df9d49fe9ca878190471ac6697b636c (patch) | |
tree | b53844bb30503c63fe1ac3c9017ea01db092bd4d /src/nvim/ops.c | |
parent | f42657cbcf0e5775692b57e25591d42844a81934 (diff) | |
download | rneovim-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/ops.c')
-rw-r--r-- | src/nvim/ops.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c index f2859bf707..6b8658f9b6 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -6485,6 +6485,8 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank) get_op_char(oap->op_type), get_extra_op_char(oap->op_type), oap->motion_force, cap->cmdchar, cap->nchar); } else if (cap->cmdchar != ':' && cap->cmdchar != K_COMMAND) { + int opchar = get_op_char(oap->op_type); + int extra_opchar = get_extra_op_char(oap->op_type); int nchar = oap->op_type == OP_REPLACE ? cap->nchar : NUL; // reverse what nv_replace() did @@ -6493,8 +6495,13 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank) } else if (nchar == REPLACE_NL_NCHAR) { nchar = NL; } - prep_redo(oap->regname, 0L, NUL, 'v', get_op_char(oap->op_type), - get_extra_op_char(oap->op_type), nchar); + + if (opchar == 'g' && extra_opchar == '@') { + // also repeat the count for 'operatorfunc' + prep_redo_num2(oap->regname, 0L, NUL, 'v', cap->count0, opchar, extra_opchar, nchar); + } else { + prep_redo(oap->regname, 0L, NUL, 'v', opchar, extra_opchar, nchar); + } } if (!redo_VIsual_busy) { redo_VIsual_mode = resel_VIsual_mode; |