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

@@ -253,7 +253,6 @@ static int ins_eol __ARGS((int c));
#ifdef FEAT_DIGRAPHS
static int ins_digraph __ARGS((void));
#endif
static int ins_copychar __ARGS((linenr_T lnum));
static int ins_ctrl_ey __ARGS((int tc));
#ifdef FEAT_SMARTINDENT
static void ins_try_si __ARGS((int c));
@@ -9899,7 +9898,7 @@ ins_digraph()
* Handle CTRL-E and CTRL-Y in Insert mode: copy char from other line.
* Returns the char to be inserted, or NUL if none found.
*/
static int
int
ins_copychar(lnum)
linenr_T lnum;
{

View File

@@ -7070,6 +7070,17 @@ nv_replace(cap)
for (n = cap->count1; n > 0; --n)
{
State = REPLACE;
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)
@@ -7092,6 +7103,14 @@ nv_replace(cap)
* line will be changed.
*/
ptr = ml_get_buf(curbuf, curwin->w_cursor.lnum, TRUE);
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);

View File

@@ -39,4 +39,5 @@ int in_cinkeys __ARGS((int keytyped, int when, int line_is_empty));
int hkmap __ARGS((int c));
void ins_scroll __ARGS((void));
void ins_horscroll __ARGS((void));
int ins_copychar __ARGS((linenr_T lnum));
/* vim: set ft=c : */

View File

@@ -714,6 +714,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
513,
/**/
512,
/**/