comparison src/ops.c @ 26226:9a8e9383e4cd v8.2.3644

patch 8.2.3644: count for 'operatorfunc' in Visual mode is not redone Commit: https://github.com/vim/vim/commit/2228cd72cf7c6f326e4e41179e88d37595ca4abc Author: Bram Moolenaar <Bram@vim.org> Date: Mon Nov 22 14:16:08 2021 +0000 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 https://github.com/vim/vim/issues/9174)
author Bram Moolenaar <Bram@vim.org>
date Mon, 22 Nov 2021 15:30:08 +0100
parents 6b4f017d7005
children 294736db2561
comparison
equal deleted inserted replaced
26225:b0c79beaf975 26226:9a8e9383e4cd
3762 get_op_char(oap->op_type), 3762 get_op_char(oap->op_type),
3763 get_extra_op_char(oap->op_type), 3763 get_extra_op_char(oap->op_type),
3764 oap->motion_force, cap->cmdchar, cap->nchar); 3764 oap->motion_force, cap->cmdchar, cap->nchar);
3765 else if (cap->cmdchar != ':' && cap->cmdchar != K_COMMAND) 3765 else if (cap->cmdchar != ':' && cap->cmdchar != K_COMMAND)
3766 { 3766 {
3767 int opchar = get_op_char(oap->op_type);
3768 int extra_opchar = get_extra_op_char(oap->op_type);
3767 int nchar = oap->op_type == OP_REPLACE ? cap->nchar : NUL; 3769 int nchar = oap->op_type == OP_REPLACE ? cap->nchar : NUL;
3768 3770
3769 // reverse what nv_replace() did 3771 // reverse what nv_replace() did
3770 if (nchar == REPLACE_CR_NCHAR) 3772 if (nchar == REPLACE_CR_NCHAR)
3771 nchar = CAR; 3773 nchar = CAR;
3772 else if (nchar == REPLACE_NL_NCHAR) 3774 else if (nchar == REPLACE_NL_NCHAR)
3773 nchar = NL; 3775 nchar = NL;
3774 prep_redo(oap->regname, 0L, NUL, 'v', 3776
3775 get_op_char(oap->op_type), 3777 if (opchar == 'g' && extra_opchar == '@')
3776 get_extra_op_char(oap->op_type), 3778 // also repeat the count for 'operatorfunc'
3777 nchar); 3779 prep_redo_num2(oap->regname, 0L, NUL, 'v',
3780 cap->count0, opchar, extra_opchar, nchar);
3781 else
3782 prep_redo(oap->regname, 0L, NUL, 'v',
3783 opchar, extra_opchar, nchar);
3778 } 3784 }
3779 if (!redo_VIsual_busy) 3785 if (!redo_VIsual_busy)
3780 { 3786 {
3781 redo_VIsual_mode = resel_VIsual_mode; 3787 redo_VIsual_mode = resel_VIsual_mode;
3782 redo_VIsual_vcol = resel_VIsual_vcol; 3788 redo_VIsual_vcol = resel_VIsual_vcol;