summaryrefslogtreecommitdiffstats
path: root/source/ap/vim/patches/7.3.513
blob: 396969f50a8ae659770a205df6dea3dd7aa645b1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
To: vim_dev@googlegroups.com
Subject: Patch 7.3.513
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 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)
Files:	    src/edit.c, src/normal.c, src/proto/edit.pro


*** ../vim-7.3.512/src/edit.c	2012-04-05 16:07:01.000000000 +0200
--- src/edit.c	2012-04-30 17:53:47.000000000 +0200
***************
*** 253,259 ****
  #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));
--- 253,258 ----
***************
*** 9899,9905 ****
   * 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
  ins_copychar(lnum)
      linenr_T	lnum;
  {
--- 9898,9904 ----
   * 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.
   */
!     int
  ins_copychar(lnum)
      linenr_T	lnum;
  {
*** ../vim-7.3.512/src/normal.c	2012-03-28 12:59:53.000000000 +0200
--- src/normal.c	2012-04-30 18:06:13.000000000 +0200
***************
*** 7070,7076 ****
  	    for (n = cap->count1; n > 0; --n)
  	    {
  		State = REPLACE;
! 		ins_char(cap->nchar);
  		State = old_State;
  		if (cap->ncharC1 != 0)
  		    ins_char(cap->ncharC1);
--- 7070,7087 ----
  	    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)
  		    ins_char(cap->ncharC1);
***************
*** 7092,7098 ****
  		 * line will be changed.
  		 */
  		ptr = ml_get_buf(curbuf, curwin->w_cursor.lnum, TRUE);
! 		ptr[curwin->w_cursor.col] = cap->nchar;
  		if (p_sm && msg_silent == 0)
  		    showmatch(cap->nchar);
  		++curwin->w_cursor.col;
--- 7103,7117 ----
  		 * 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);
  		++curwin->w_cursor.col;
*** ../vim-7.3.512/src/proto/edit.pro	2010-08-15 21:57:28.000000000 +0200
--- src/proto/edit.pro	2012-04-30 17:54:41.000000000 +0200
***************
*** 39,42 ****
--- 39,43 ----
  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 : */
*** ../vim-7.3.512/src/version.c	2012-04-30 17:35:44.000000000 +0200
--- src/version.c	2012-04-30 18:17:52.000000000 +0200
***************
*** 716,717 ****
--- 716,719 ----
  {   /* Add new patch number below this line */
+ /**/
+     513,
  /**/

-- 
It is illegal for anyone to try and stop a child from playfully jumping over
puddles of water.
		[real standing law in California, United States of America]

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///