vim-patch:7.4.765

Problem:    CTRL-A and CTRL-X in Visual mode do not always work well.
Solution:   Improvements for increment and decrement. (Christian Brabandt)

9bb1930af9
This commit is contained in:
watiko
2016-01-14 18:49:35 +09:00
parent 6d1b948b6b
commit 5ef1cb5c2e
5 changed files with 441 additions and 28 deletions

View File

@@ -3506,7 +3506,21 @@ static void nv_addsub(cmdarg_T *cap)
bool visual = VIsual_active;
if (cap->oap->op_type == OP_NOP
&& do_addsub((int)cap->cmdchar, cap->count1, cap->arg) == OK) {
prep_redo_cmd(cap);
if (visual) {
ResetRedobuff();
AppendCharToRedobuff(VIsual_mode);
if (VIsual_mode == 'V') {
AppendNumberToRedobuff(cap->oap->line_count);
AppendCharToRedobuff('j');
}
AppendNumberToRedobuff(cap->count1);
if (cap->nchar != NUL) {
AppendCharToRedobuff(cap->nchar);
}
AppendCharToRedobuff(cap->cmdchar);
} else {
prep_redo_cmd(cap);
}
} else {
clearopbeep(cap->oap);
}