1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Cannot use CTRL-E and CTRL-Y with "r".
12 Solution: Make CTRL-E and CTRL-Y work like in Insert mode. (Christian
14 Files: src/edit.c, src/normal.c, src/proto/edit.pro
17 *** ../vim-7.3.512/src/edit.c 2012-04-05 16:07:01.000000000 +0200
18 --- src/edit.c 2012-04-30 17:53:47.000000000 +0200
22 static int ins_digraph __ARGS((void));
24 - static int ins_copychar __ARGS((linenr_T lnum));
25 static int ins_ctrl_ey __ARGS((int tc));
26 #ifdef FEAT_SMARTINDENT
27 static void ins_try_si __ARGS((int c));
31 * Handle CTRL-E and CTRL-Y in Insert mode: copy char from other line.
32 * Returns the char to be inserted, or NUL if none found.
39 * Handle CTRL-E and CTRL-Y in Insert mode: copy char from other line.
40 * Returns the char to be inserted, or NUL if none found.
46 *** ../vim-7.3.512/src/normal.c 2012-03-28 12:59:53.000000000 +0200
47 --- src/normal.c 2012-04-30 18:06:13.000000000 +0200
50 for (n = cap->count1; n > 0; --n)
53 ! ins_char(cap->nchar);
55 if (cap->ncharC1 != 0)
56 ins_char(cap->ncharC1);
58 for (n = cap->count1; n > 0; --n)
61 ! if (cap->nchar == Ctrl_E || cap->nchar == Ctrl_Y)
63 ! int c = ins_copychar(curwin->w_cursor.lnum
64 ! + (cap->nchar == Ctrl_Y ? -1 : 1));
68 ! /* will be decremented further down */
69 ! ++curwin->w_cursor.col;
72 ! ins_char(cap->nchar);
74 if (cap->ncharC1 != 0)
75 ins_char(cap->ncharC1);
78 * line will be changed.
80 ptr = ml_get_buf(curbuf, curwin->w_cursor.lnum, TRUE);
81 ! ptr[curwin->w_cursor.col] = cap->nchar;
82 if (p_sm && msg_silent == 0)
83 showmatch(cap->nchar);
84 ++curwin->w_cursor.col;
86 * line will be changed.
88 ptr = ml_get_buf(curbuf, curwin->w_cursor.lnum, TRUE);
89 ! if (cap->nchar == Ctrl_E || cap->nchar == Ctrl_Y)
91 ! int c = ins_copychar(curwin->w_cursor.lnum
92 ! + (cap->nchar == Ctrl_Y ? -1 : 1));
94 ! ptr[curwin->w_cursor.col] = c;
97 ! ptr[curwin->w_cursor.col] = cap->nchar;
98 if (p_sm && msg_silent == 0)
99 showmatch(cap->nchar);
100 ++curwin->w_cursor.col;
101 *** ../vim-7.3.512/src/proto/edit.pro 2010-08-15 21:57:28.000000000 +0200
102 --- src/proto/edit.pro 2012-04-30 17:54:41.000000000 +0200
106 int hkmap __ARGS((int c));
107 void ins_scroll __ARGS((void));
108 void ins_horscroll __ARGS((void));
109 + int ins_copychar __ARGS((linenr_T lnum));
110 /* vim: set ft=c : */
111 *** ../vim-7.3.512/src/version.c 2012-04-30 17:35:44.000000000 +0200
112 --- src/version.c 2012-04-30 18:17:52.000000000 +0200
116 { /* Add new patch number below this line */
122 It is illegal for anyone to try and stop a child from playfully jumping over
124 [real standing law in California, United States of America]
126 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
127 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
128 \\\ an exciting new programming language -- http://www.Zimbu.org ///
129 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///