]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
updated for version 7.3.513 v7.3.513
authorBram Moolenaar <Bram@vim.org>
Mon, 30 Apr 2012 16:18:47 +0000 (18:18 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 30 Apr 2012 16:18:47 +0000 (18:18 +0200)
Problem:    Cannot use CTRL-E and CTRL-Y with "r".
Solution:   Make CTRL-E and CTRL-Y work like in Insert mode. (Christian
            Brabandt)

src/edit.c
src/normal.c
src/proto/edit.pro
src/version.c

index c8320a6e23b5ca3c7824578b8b503fe22ed2cf13..17bbc6f2eec9316697e006d3b2ff0a4ebc31854d 100644 (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;
 {
index a7301162bd2accf6b88c3b0c0f21bcf3c1430005..98f4a0a9f0772f6f3a6367c7d1d3571125433cf1 100644 (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;
index e2398c452b0fd262532f983f4b645fc3a209fecd..1eed378706a804735029cd8fabab32745e1241a7 100644 (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 : */
index ce22d9f99cef87950b6ab447c15e36b40c5bf0e4..de24ff4bd67b7bbb4e6277aa221b1af9e25ccc0f 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    513,
 /**/
     512,
 /**/