summaryrefslogtreecommitdiffstats
path: root/patches/source/vim/patches/7.4.269
blob: 80f29a486b75f4d62e202c54d8a0d574f25a292e (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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
To: vim_dev@googlegroups.com
Subject: Patch 7.4.269
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.4.269
Problem:    CTRL-U in Insert mode does not work after using a cursor key.
	    (Pine Wu)
Solution:   Use the original insert start position. (Christian Brabandt)
Files:	    src/edit.c, src/testdir/test29.in, src/testdir/test29.ok


*** ../vim-7.4.268/src/edit.c	2014-04-29 12:15:22.852032651 +0200
--- src/edit.c	2014-04-29 14:44:07.867876234 +0200
***************
*** 8760,8767 ****
  		((curwin->w_cursor.lnum == 1 && curwin->w_cursor.col == 0)
  		    || (!can_bs(BS_START)
  			&& (arrow_used
! 			    || (curwin->w_cursor.lnum == Insstart.lnum
! 				&& curwin->w_cursor.col <= Insstart.col)))
  		    || (!can_bs(BS_INDENT) && !arrow_used && ai_col > 0
  					 && curwin->w_cursor.col <= ai_col)
  		    || (!can_bs(BS_EOL) && curwin->w_cursor.col == 0))))
--- 8760,8767 ----
  		((curwin->w_cursor.lnum == 1 && curwin->w_cursor.col == 0)
  		    || (!can_bs(BS_START)
  			&& (arrow_used
! 			    || (curwin->w_cursor.lnum == Insstart_orig.lnum
! 				&& curwin->w_cursor.col <= Insstart_orig.col)))
  		    || (!can_bs(BS_INDENT) && !arrow_used && ai_col > 0
  					 && curwin->w_cursor.col <= ai_col)
  		    || (!can_bs(BS_EOL) && curwin->w_cursor.col == 0))))
***************
*** 8812,8819 ****
       */
      if (curwin->w_cursor.col == 0)
      {
! 	lnum = Insstart.lnum;
! 	if (curwin->w_cursor.lnum == Insstart.lnum
  #ifdef FEAT_RIGHTLEFT
  			|| revins_on
  #endif
--- 8812,8819 ----
       */
      if (curwin->w_cursor.col == 0)
      {
! 	lnum = Insstart_orig.lnum;
! 	if (curwin->w_cursor.lnum == lnum
  #ifdef FEAT_RIGHTLEFT
  			|| revins_on
  #endif
***************
*** 8822,8829 ****
  	    if (u_save((linenr_T)(curwin->w_cursor.lnum - 2),
  			       (linenr_T)(curwin->w_cursor.lnum + 1)) == FAIL)
  		return FALSE;
! 	    --Insstart.lnum;
! 	    Insstart.col = MAXCOL;
  	}
  	/*
  	 * In replace mode:
--- 8822,8829 ----
  	    if (u_save((linenr_T)(curwin->w_cursor.lnum - 2),
  			       (linenr_T)(curwin->w_cursor.lnum + 1)) == FAIL)
  		return FALSE;
! 	    --Insstart_orig.lnum;
! 	    Insstart_orig.col = MAXCOL;
  	}
  	/*
  	 * In replace mode:
***************
*** 8981,8989 ****
  	    while (vcol < want_vcol)
  	    {
  		/* Remember the first char we inserted */
! 		if (curwin->w_cursor.lnum == Insstart.lnum
! 				   && curwin->w_cursor.col < Insstart.col)
! 		    Insstart.col = curwin->w_cursor.col;
  
  #ifdef FEAT_VREPLACE
  		if (State & VREPLACE_FLAG)
--- 8981,8989 ----
  	    while (vcol < want_vcol)
  	    {
  		/* Remember the first char we inserted */
! 		if (curwin->w_cursor.lnum == Insstart_orig.lnum
! 				   && curwin->w_cursor.col < Insstart_orig.col)
! 		    Insstart_orig.col = curwin->w_cursor.col;
  
  #ifdef FEAT_VREPLACE
  		if (State & VREPLACE_FLAG)
***************
*** 9071,9078 ****
  		revins_on ||
  #endif
  		(curwin->w_cursor.col > mincol
! 		 && (curwin->w_cursor.lnum != Insstart.lnum
! 		     || curwin->w_cursor.col != Insstart.col)));
  	did_backspace = TRUE;
      }
  #ifdef FEAT_SMARTINDENT
--- 9071,9078 ----
  		revins_on ||
  #endif
  		(curwin->w_cursor.col > mincol
! 		 && (curwin->w_cursor.lnum != Insstart_orig.lnum
! 		     || curwin->w_cursor.col != Insstart_orig.col)));
  	did_backspace = TRUE;
      }
  #ifdef FEAT_SMARTINDENT
***************
*** 9090,9098 ****
      AppendCharToRedobuff(c);
  
      /* If deleted before the insertion point, adjust it */
!     if (curwin->w_cursor.lnum == Insstart.lnum
! 				       && curwin->w_cursor.col < Insstart.col)
! 	Insstart.col = curwin->w_cursor.col;
  
      /* vi behaviour: the cursor moves backward but the character that
       *		     was there remains visible
--- 9090,9098 ----
      AppendCharToRedobuff(c);
  
      /* If deleted before the insertion point, adjust it */
!     if (curwin->w_cursor.lnum == Insstart_orig.lnum
! 				       && curwin->w_cursor.col < Insstart_orig.col)
! 	Insstart_orig.col = curwin->w_cursor.col;
  
      /* vi behaviour: the cursor moves backward but the character that
       *		     was there remains visible
*** ../vim-7.4.268/src/testdir/test29.in	2012-06-13 13:48:26.000000000 +0200
--- src/testdir/test29.in	2014-04-29 14:31:23.619889628 +0200
***************
*** 102,107 ****
--- 102,135 ----
  }
  
  STARTTEST
+ :" Test with backspace set to the non-compatible setting
+ /^\d\+ this
+ :set cp bs=2
+ Avim1
+ Avim2u
+ :set cpo-=<
+ :inoremap <c-u> <left><c-u>
+ Avim3
+ :iunmap <c-u>
+ Avim4
+ :" Test with backspace set to the compatible setting
+ :set bs=
+ A vim5A
+ A vim6Azweiu
+ :inoremap <c-u> <left><c-u>
+ A vim7
+ :set cp
+ ENDTEST
+ 1 this shouldn't be deleted
+ 2 this shouldn't be deleted
+ 3 this shouldn't be deleted
+ 4 this should be deleted
+ 5 this shouldn't be deleted
+ 6 this shouldn't be deleted
+ 7 this shouldn't be deleted
+ 8 this shouldn't be deleted (not touched yet)
+ 
+ STARTTEST
  /^{/+1
  :set comments=sO:*\ -,mO:*\ \ ,exO:*/
  :set comments+=s1:/*,mb:*,ex:*/,://
*** ../vim-7.4.268/src/testdir/test29.ok	2012-06-13 13:48:26.000000000 +0200
--- src/testdir/test29.ok	2014-04-29 14:31:23.623889628 +0200
***************
*** 62,67 ****
--- 62,76 ----
      action();
  }
  
+ 1 this shouldn't be deleted
+ 2 this shouldn't be deleted
+ 3 this shouldn't be deleted
+ 4 this should be deleted3
+ 
+ 6 this shouldn't be deleted vim5
+ 7 this shouldn't be deleted vim6
+ 8 this shouldn't be deleted (not touched yet) vim7
+ 
  
  {
  /* Make sure the previous comment leader is not removed.  */
*** ../vim-7.4.268/src/version.c	2014-04-29 14:02:42.547919791 +0200
--- src/version.c	2014-04-29 14:42:09.083878315 +0200
***************
*** 736,737 ****
--- 736,739 ----
  {   /* Add new patch number below this line */
+ /**/
+     269,
  /**/

-- 
From "know your smileys":
 [:-)	Frankenstein's monster

 /// 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    ///