vim-patch:8.2.4242: put in Visual mode cannot be repeated

Problem:    Put in Visual mode cannot be repeated.
Solution:   Use "P" to put without yanking the deleted text into the unnamed
            register. (Shougo Matsushita, closes vim/vim#9591)
fb55207ed1

Cherry-pick get_y_previous() and set_y_previous() from patch 8.1.1736.
Nvim has removed y_current, so code related to it is N/A.
This commit is contained in:
zeertzjq
2022-02-09 14:21:04 +08:00
parent 07c97fa02d
commit d9cb3fba92
5 changed files with 56 additions and 9 deletions

View File

@@ -135,10 +135,18 @@ static char opchars[][3] =
{ Ctrl_X, NUL, OPF_CHANGE }, // OP_NR_SUB
};
/*
* Translate a command name into an operator type.
* Must only be called with a valid operator name!
*/
yankreg_T *get_y_previous(void)
{
return y_previous;
}
void set_y_previous(yankreg_T *yreg)
{
y_previous = yreg;
}
/// Translate a command name into an operator type.
/// Must only be called with a valid operator name!
int get_op_type(int char1, int char2)
{
int i;