summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.1000
blob: 2eacb772a8312308a8eb73ba5e3e2a04ae0d1876 (plain)
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1000
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.1000
Problem:    Indenting is off.
Solution:   Make indenting consistent and update comments. (Ozaki Kiichi,
            closes #4079)
Files:	    src/getchar.c, src/ops.c


*** ../vim-8.1.0999/src/getchar.c	2019-02-17 17:44:36.207875527 +0100
--- src/getchar.c	2019-03-09 08:53:59.569644721 +0100
***************
*** 1577,1684 ****
      }
      else
      {
!       mod_mask = 0x0;
!       last_recorded_len = 0;
!       for (;;)			/* this is done twice if there are modifiers */
!       {
! 	int did_inc = FALSE;
! 
! 	if (mod_mask
! #if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
! 	    || im_is_preediting()
! #endif
! 		)
! 	{
! 	    /* no mapping after modifier has been read */
! 	    ++no_mapping;
! 	    ++allow_keys;
! 	    did_inc = TRUE;	/* mod_mask may change value */
! 	}
! 	c = vgetorpeek(TRUE);
! 	if (did_inc)
  	{
! 	    --no_mapping;
! 	    --allow_keys;
! 	}
  
! 	/* Get two extra bytes for special keys */
! 	if (c == K_SPECIAL
! #ifdef FEAT_GUI
! 		|| c == CSI
  #endif
! 	   )
! 	{
! 	    int	    save_allow_keys = allow_keys;
! 
! 	    ++no_mapping;
! 	    allow_keys = 0;		/* make sure BS is not found */
! 	    c2 = vgetorpeek(TRUE);	/* no mapping for these chars */
  	    c = vgetorpeek(TRUE);
! 	    --no_mapping;
! 	    allow_keys = save_allow_keys;
! 	    if (c2 == KS_MODIFIER)
  	    {
! 		mod_mask = c;
! 		continue;
  	    }
- 	    c = TO_SPECIAL(c2, c);
  
! #if defined(FEAT_GUI_MSWIN) && defined(FEAT_MENU) && defined(FEAT_TEAROFF)
! 	    /* Handle K_TEAROFF here, the caller of vgetc() doesn't need to
! 	     * know that a menu was torn off */
! 	    if (c == K_TEAROFF)
  	    {
! 		char_u	name[200];
! 		int	i;
  
! 		/* get menu path, it ends with a <CR> */
! 		for (i = 0; (c = vgetorpeek(TRUE)) != '\r'; )
  		{
! 		    name[i] = c;
! 		    if (i < 199)
! 			++i;
  		}
- 		name[i] = NUL;
- 		gui_make_tearoff(name);
- 		continue;
- 	    }
  #endif
  #if defined(FEAT_GUI) && defined(FEAT_GUI_GTK) && defined(FEAT_MENU)
! 	    /* GTK: <F10> normally selects the menu, but it's passed until
! 	     * here to allow mapping it.  Intercept and invoke the GTK
! 	     * behavior if it's not mapped. */
! 	    if (c == K_F10 && gui.menubar != NULL)
! 	    {
! 		gtk_menu_shell_select_first(GTK_MENU_SHELL(gui.menubar), FALSE);
! 		continue;
! 	    }
  #endif
  #ifdef FEAT_GUI
! 	    /* Handle focus event here, so that the caller doesn't need to
! 	     * know about it.  Return K_IGNORE so that we loop once (needed if
! 	     * 'lazyredraw' is set). */
! 	    if (c == K_FOCUSGAINED || c == K_FOCUSLOST)
! 	    {
! 		ui_focus_change(c == K_FOCUSGAINED);
! 		c = K_IGNORE;
! 	    }
  
! 	    /* Translate K_CSI to CSI.  The special key is only used to avoid
! 	     * it being recognized as the start of a special key. */
! 	    if (c == K_CSI)
! 		c = CSI;
  #endif
! 	}
! 	/* a keypad or special function key was not mapped, use it like
! 	 * its ASCII equivalent */
! 	switch (c)
! 	{
! 	    case K_KPLUS:	c = '+'; break;
! 	    case K_KMINUS:	c = '-'; break;
! 	    case K_KDIVIDE:	c = '/'; break;
! 	    case K_KMULTIPLY:	c = '*'; break;
! 	    case K_KENTER:	c = CAR; break;
! 	    case K_KPOINT:
  #ifdef MSWIN
  				// Can be either '.' or a ',',
  				// depending on the type of keypad.
--- 1577,1685 ----
      }
      else
      {
! 	mod_mask = 0x0;
! 	last_recorded_len = 0;
! 	for (;;)		// this is done twice if there are modifiers
  	{
! 	    int did_inc = FALSE;
  
! 	    if (mod_mask
! #if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
! 		    || im_is_preediting()
  #endif
! 		    )
! 	    {
! 		// no mapping after modifier has been read
! 		++no_mapping;
! 		++allow_keys;
! 		did_inc = TRUE;	// mod_mask may change value
! 	    }
  	    c = vgetorpeek(TRUE);
! 	    if (did_inc)
  	    {
! 		--no_mapping;
! 		--allow_keys;
  	    }
  
! 	    // Get two extra bytes for special keys
! 	    if (c == K_SPECIAL
! #ifdef FEAT_GUI
! 		    || c == CSI
! #endif
! 	       )
  	    {
! 		int	    save_allow_keys = allow_keys;
  
! 		++no_mapping;
! 		allow_keys = 0;		// make sure BS is not found
! 		c2 = vgetorpeek(TRUE);	// no mapping for these chars
! 		c = vgetorpeek(TRUE);
! 		--no_mapping;
! 		allow_keys = save_allow_keys;
! 		if (c2 == KS_MODIFIER)
  		{
! 		    mod_mask = c;
! 		    continue;
! 		}
! 		c = TO_SPECIAL(c2, c);
! 
! #if defined(FEAT_GUI_MSWIN) && defined(FEAT_MENU) && defined(FEAT_TEAROFF)
! 		// Handle K_TEAROFF here, the caller of vgetc() doesn't need to
! 		// know that a menu was torn off
! 		if (c == K_TEAROFF)
! 		{
! 		    char_u	name[200];
! 		    int		i;
! 
! 		    // get menu path, it ends with a <CR>
! 		    for (i = 0; (c = vgetorpeek(TRUE)) != '\r'; )
! 		    {
! 			name[i] = c;
! 			if (i < 199)
! 			    ++i;
! 		    }
! 		    name[i] = NUL;
! 		    gui_make_tearoff(name);
! 		    continue;
  		}
  #endif
  #if defined(FEAT_GUI) && defined(FEAT_GUI_GTK) && defined(FEAT_MENU)
! 		// GTK: <F10> normally selects the menu, but it's passed until
! 		// here to allow mapping it.  Intercept and invoke the GTK
! 		// behavior if it's not mapped.
! 		if (c == K_F10 && gui.menubar != NULL)
! 		{
! 		    gtk_menu_shell_select_first(
! 					   GTK_MENU_SHELL(gui.menubar), FALSE);
! 		    continue;
! 		}
  #endif
  #ifdef FEAT_GUI
! 		// Handle focus event here, so that the caller doesn't need to
! 		// know about it.  Return K_IGNORE so that we loop once (needed
! 		// if 'lazyredraw' is set).
! 		if (c == K_FOCUSGAINED || c == K_FOCUSLOST)
! 		{
! 		    ui_focus_change(c == K_FOCUSGAINED);
! 		    c = K_IGNORE;
! 		}
  
! 		// Translate K_CSI to CSI.  The special key is only used to
! 		// avoid it being recognized as the start of a special key.
! 		if (c == K_CSI)
! 		    c = CSI;
  #endif
! 	    }
! 	    // a keypad or special function key was not mapped, use it like
! 	    // its ASCII equivalent
! 	    switch (c)
! 	    {
! 		case K_KPLUS:	c = '+'; break;
! 		case K_KMINUS:	c = '-'; break;
! 		case K_KDIVIDE:	c = '/'; break;
! 		case K_KMULTIPLY: c = '*'; break;
! 		case K_KENTER:	c = CAR; break;
! 		case K_KPOINT:
  #ifdef MSWIN
  				// Can be either '.' or a ',',
  				// depending on the type of keypad.
***************
*** 1686,1704 ****
  #else
  				c = '.'; break;
  #endif
! 	    case K_K0:		c = '0'; break;
! 	    case K_K1:		c = '1'; break;
! 	    case K_K2:		c = '2'; break;
! 	    case K_K3:		c = '3'; break;
! 	    case K_K4:		c = '4'; break;
! 	    case K_K5:		c = '5'; break;
! 	    case K_K6:		c = '6'; break;
! 	    case K_K7:		c = '7'; break;
! 	    case K_K8:		c = '8'; break;
! 	    case K_K9:		c = '9'; break;
  
! 	    case K_XHOME:
! 	    case K_ZHOME:	if (mod_mask == MOD_MASK_SHIFT)
  				{
  				    c = K_S_HOME;
  				    mod_mask = 0;
--- 1687,1705 ----
  #else
  				c = '.'; break;
  #endif
! 		case K_K0:	c = '0'; break;
! 		case K_K1:	c = '1'; break;
! 		case K_K2:	c = '2'; break;
! 		case K_K3:	c = '3'; break;
! 		case K_K4:	c = '4'; break;
! 		case K_K5:	c = '5'; break;
! 		case K_K6:	c = '6'; break;
! 		case K_K7:	c = '7'; break;
! 		case K_K8:	c = '8'; break;
! 		case K_K9:	c = '9'; break;
  
! 		case K_XHOME:
! 		case K_ZHOME:	if (mod_mask == MOD_MASK_SHIFT)
  				{
  				    c = K_S_HOME;
  				    mod_mask = 0;
***************
*** 1711,1718 ****
  				else
  				    c = K_HOME;
  				break;
! 	    case K_XEND:
! 	    case K_ZEND:	if (mod_mask == MOD_MASK_SHIFT)
  				{
  				    c = K_S_END;
  				    mod_mask = 0;
--- 1712,1719 ----
  				else
  				    c = K_HOME;
  				break;
! 		case K_XEND:
! 		case K_ZEND:	if (mod_mask == MOD_MASK_SHIFT)
  				{
  				    c = K_S_END;
  				    mod_mask = 0;
***************
*** 1726,1770 ****
  				    c = K_END;
  				break;
  
! 	    case K_XUP:		c = K_UP; break;
! 	    case K_XDOWN:	c = K_DOWN; break;
! 	    case K_XLEFT:	c = K_LEFT; break;
! 	    case K_XRIGHT:	c = K_RIGHT; break;
! 	}
  
! 	/* For a multi-byte character get all the bytes and return the
! 	 * converted character.
! 	 * Note: This will loop until enough bytes are received!
! 	 */
! 	if (has_mbyte && (n = MB_BYTE2LEN_CHECK(c)) > 1)
! 	{
! 	    ++no_mapping;
! 	    buf[0] = c;
! 	    for (i = 1; i < n; ++i)
  	    {
! 		buf[i] = vgetorpeek(TRUE);
! 		if (buf[i] == K_SPECIAL
  #ifdef FEAT_GUI
! 			|| buf[i] == CSI
  #endif
! 			)
! 		{
! 		    /* Must be a K_SPECIAL - KS_SPECIAL - KE_FILLER sequence,
! 		     * which represents a K_SPECIAL (0x80),
! 		     * or a CSI - KS_EXTRA - KE_CSI sequence, which represents
! 		     * a CSI (0x9B),
! 		     * of a K_SPECIAL - KS_EXTRA - KE_CSI, which is CSI too. */
! 		    c = vgetorpeek(TRUE);
! 		    if (vgetorpeek(TRUE) == (int)KE_CSI && c == KS_EXTRA)
! 			buf[i] = CSI;
  		}
  	    }
- 	    --no_mapping;
- 	    c = (*mb_ptr2char)(buf);
- 	}
  
! 	break;
!       }
      }
  
  #ifdef FEAT_EVAL
--- 1727,1771 ----
  				    c = K_END;
  				break;
  
! 		case K_XUP:	c = K_UP; break;
! 		case K_XDOWN:	c = K_DOWN; break;
! 		case K_XLEFT:	c = K_LEFT; break;
! 		case K_XRIGHT:	c = K_RIGHT; break;
! 	    }
  
! 	    // For a multi-byte character get all the bytes and return the
! 	    // converted character.
! 	    // Note: This will loop until enough bytes are received!
! 	    if (has_mbyte && (n = MB_BYTE2LEN_CHECK(c)) > 1)
  	    {
! 		++no_mapping;
! 		buf[0] = c;
! 		for (i = 1; i < n; ++i)
! 		{
! 		    buf[i] = vgetorpeek(TRUE);
! 		    if (buf[i] == K_SPECIAL
  #ifdef FEAT_GUI
! 			    || buf[i] == CSI
  #endif
! 			    )
! 		    {
! 			// Must be a K_SPECIAL - KS_SPECIAL - KE_FILLER
! 			// sequence, which represents a K_SPECIAL (0x80),
! 			// or a CSI - KS_EXTRA - KE_CSI sequence, which
! 			// represents a CSI (0x9B),
! 			// or a K_SPECIAL - KS_EXTRA - KE_CSI, which is CSI
! 			// too.
! 			c = vgetorpeek(TRUE);
! 			if (vgetorpeek(TRUE) == (int)KE_CSI && c == KS_EXTRA)
! 			    buf[i] = CSI;
! 		    }
  		}
+ 		--no_mapping;
+ 		c = (*mb_ptr2char)(buf);
  	    }
  
! 	    break;
! 	}
      }
  
  #ifdef FEAT_EVAL
*** ../vim-8.1.0999/src/ops.c	2019-03-08 09:50:43.058308765 +0100
--- src/ops.c	2019-03-09 09:06:12.268015674 +0100
***************
*** 1245,1254 ****
  	    emsg(_(e_nolastcmd));
  	    return FAIL;
  	}
! 	VIM_CLEAR(new_last_cmdline); /* don't keep the cmdline containing @: */
! 	/* Escape all control characters with a CTRL-V */
  	p = vim_strsave_escaped_ext(last_cmdline,
! 		(char_u *)"\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037", Ctrl_V, FALSE);
  	if (p != NULL)
  	{
  	    /* When in Visual mode "'<,'>" will be prepended to the command.
--- 1245,1259 ----
  	    emsg(_(e_nolastcmd));
  	    return FAIL;
  	}
! 	// don't keep the cmdline containing @:
! 	VIM_CLEAR(new_last_cmdline);
! 	// Escape all control characters with a CTRL-V
  	p = vim_strsave_escaped_ext(last_cmdline,
! 		    (char_u *)"\001\002\003\004\005\006\007"
! 			  "\010\011\012\013\014\015\016\017"
! 			  "\020\021\022\023\024\025\026\027"
! 			  "\030\031\032\033\034\035\036\037",
! 		    Ctrl_V, FALSE);
  	if (p != NULL)
  	{
  	    /* When in Visual mode "'<,'>" will be prepended to the command.
*** ../vim-8.1.0999/src/version.c	2019-03-08 09:50:43.062308735 +0100
--- src/version.c	2019-03-09 09:01:15.642242661 +0100
***************
*** 781,782 ****
--- 781,784 ----
  {   /* Add new patch number below this line */
+ /**/
+     1000,
  /**/

-- 
I started out with nothing, and I still have most of it.
                                -- Michael Davis -- "Tonight Show"

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