0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

updated for version 7.3.513

Problem:    Cannot use CTRL-E and CTRL-Y with "r".
Solution:   Make CTRL-E and CTRL-Y work like in Insert mode. (Christian
            Brabandt)
This commit is contained in:
Bram Moolenaar
2012-04-30 18:18:47 +02:00
parent b41d9689f1
commit 8320da42bc
4 changed files with 25 additions and 4 deletions

View File

@@ -7070,7 +7070,18 @@ nv_replace(cap)
for (n = cap->count1; n > 0; --n)
{
State = REPLACE;
ins_char(cap->nchar);
if (cap->nchar == Ctrl_E || cap->nchar == Ctrl_Y)
{
int c = ins_copychar(curwin->w_cursor.lnum
+ (cap->nchar == Ctrl_Y ? -1 : 1));
if (c != NUL)
ins_char(c);
else
/* will be decremented further down */
++curwin->w_cursor.col;
}
else
ins_char(cap->nchar);
State = old_State;
if (cap->ncharC1 != 0)
ins_char(cap->ncharC1);
@@ -7092,7 +7103,15 @@ nv_replace(cap)
* line will be changed.
*/
ptr = ml_get_buf(curbuf, curwin->w_cursor.lnum, TRUE);
ptr[curwin->w_cursor.col] = cap->nchar;
if (cap->nchar == Ctrl_E || cap->nchar == Ctrl_Y)
{
int c = ins_copychar(curwin->w_cursor.lnum
+ (cap->nchar == Ctrl_Y ? -1 : 1));
if (c != NUL)
ptr[curwin->w_cursor.col] = c;
}
else
ptr[curwin->w_cursor.col] = cap->nchar;
if (p_sm && msg_silent == 0)
showmatch(cap->nchar);
++curwin->w_cursor.col;