summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0989
blob: fbc51331dc962b18f6f91b105f2d7826c4b824de (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
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0989
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.0989
Problem:    Various small code ugliness.
Solution:   Remove pointless NULL checks. Fix function calls. Fix typos.
            (Dominique Pelle, closes #4060)
Files:	    src/buffer.c, src/crypt.c, src/evalfunc.c, src/ex_cmds2.c,
            src/globals.h, src/gui_gtk_f.c, src/gui_gtk_x11.c, src/gui_mac.c,
            src/ops.c, src/option.h, src/os_unix.c, src/os_win32.c,
            src/popupmnu.c, src/regexp.c, src/ui.c, src/version.c


*** ../vim-8.1.0988/src/buffer.c	2019-02-16 19:05:07.352324625 +0100
--- src/buffer.c	2019-03-02 09:59:25.003064488 +0100
***************
*** 2163,2173 ****
      clear_string_option(&buf->b_p_isk);
  #ifdef FEAT_VARTABS
      clear_string_option(&buf->b_p_vsts);
!     if (buf->b_p_vsts_nopaste)
! 	vim_free(buf->b_p_vsts_nopaste);
      buf->b_p_vsts_nopaste = NULL;
!     if (buf->b_p_vsts_array)
! 	vim_free(buf->b_p_vsts_array);
      buf->b_p_vsts_array = NULL;
      clear_string_option(&buf->b_p_vts);
      VIM_CLEAR(buf->b_p_vts_array);
--- 2163,2171 ----
      clear_string_option(&buf->b_p_isk);
  #ifdef FEAT_VARTABS
      clear_string_option(&buf->b_p_vsts);
!     vim_free(buf->b_p_vsts_nopaste);
      buf->b_p_vsts_nopaste = NULL;
!     vim_free(buf->b_p_vsts_array);
      buf->b_p_vsts_array = NULL;
      clear_string_option(&buf->b_p_vts);
      VIM_CLEAR(buf->b_p_vts_array);
*** ../vim-8.1.0988/src/crypt.c	2019-01-19 17:43:03.401449251 +0100
--- src/crypt.c	2019-03-02 09:59:25.003064488 +0100
***************
*** 42,48 ****
      /* Optional function pointer for a self-test. */
      int (* self_test_fn)();
  
!     /* Function pointer for initializing encryption/decription. */
      void (* init_fn)(cryptstate_T *state, char_u *key,
  		      char_u *salt, int salt_len, char_u *seed, int seed_len);
  
--- 42,48 ----
      /* Optional function pointer for a self-test. */
      int (* self_test_fn)();
  
!     // Function pointer for initializing encryption/description.
      void (* init_fn)(cryptstate_T *state, char_u *key,
  		      char_u *salt, int salt_len, char_u *seed, int seed_len);
  
*** ../vim-8.1.0988/src/evalfunc.c	2019-02-26 17:03:49.841487966 +0100
--- src/evalfunc.c	2019-03-02 09:59:25.003064488 +0100
***************
*** 2451,2457 ****
  	    utf8 = (int)tv_get_number_chk(&argvars[1], NULL);
  
  	if (utf8)
! 	    rettv->vval.v_number = (*utf_ptr2char)(tv_get_string(&argvars[0]));
  	else
  	    rettv->vval.v_number = (*mb_ptr2char)(tv_get_string(&argvars[0]));
      }
--- 2451,2457 ----
  	    utf8 = (int)tv_get_number_chk(&argvars[1], NULL);
  
  	if (utf8)
! 	    rettv->vval.v_number = utf_ptr2char(tv_get_string(&argvars[0]));
  	else
  	    rettv->vval.v_number = (*mb_ptr2char)(tv_get_string(&argvars[0]));
      }
***************
*** 8701,8707 ****
  	if (argvars[1].v_type != VAR_UNKNOWN)
  	    utf8 = (int)tv_get_number_chk(&argvars[1], NULL);
  	if (utf8)
! 	    buf[(*utf_char2bytes)((int)tv_get_number(&argvars[0]), buf)] = NUL;
  	else
  	    buf[(*mb_char2bytes)((int)tv_get_number(&argvars[0]), buf)] = NUL;
      }
--- 8701,8707 ----
  	if (argvars[1].v_type != VAR_UNKNOWN)
  	    utf8 = (int)tv_get_number_chk(&argvars[1], NULL);
  	if (utf8)
! 	    buf[utf_char2bytes((int)tv_get_number(&argvars[0]), buf)] = NUL;
  	else
  	    buf[(*mb_char2bytes)((int)tv_get_number(&argvars[0]), buf)] = NUL;
      }
***************
*** 11647,11653 ****
  
      rettv->vval.v_number = -1;
  
!     // Sign identifer
      sign_id = (int)tv_get_number_chk(&argvars[0], &notanum);
      if (notanum)
  	return;
--- 11647,11653 ----
  
      rettv->vval.v_number = -1;
  
!     // Sign identifier
      sign_id = (int)tv_get_number_chk(&argvars[0], &notanum);
      if (notanum)
  	return;
***************
*** 11699,11705 ****
  
      rettv->vval.v_number = -1;
  
!     // Sign identifer
      sign_id = (int)tv_get_number_chk(&argvars[0], &notanum);
      if (notanum)
  	return;
--- 11699,11705 ----
  
      rettv->vval.v_number = -1;
  
!     // Sign identifier
      sign_id = (int)tv_get_number_chk(&argvars[0], &notanum);
      if (notanum)
  	return;
*** ../vim-8.1.0988/src/ex_cmds2.c	2019-02-17 17:44:36.203875545 +0100
--- src/ex_cmds2.c	2019-03-02 09:59:25.003064488 +0100
***************
*** 2380,2386 ****
  
  		goto_tabpage_win(tp, wp);
  
! 		/* Paranoia: did autocms wipe out the buffer with changes? */
  		if (!bufref_valid(&bufref))
  		    goto theend;
  		goto buf_found;
--- 2380,2386 ----
  
  		goto_tabpage_win(tp, wp);
  
! 		// Paranoia: did autocmd wipe out the buffer with changes?
  		if (!bufref_valid(&bufref))
  		    goto theend;
  		goto buf_found;
*** ../vim-8.1.0988/src/globals.h	2019-02-17 17:44:36.207875527 +0100
--- src/globals.h	2019-03-02 09:59:25.007064462 +0100
***************
*** 426,432 ****
  # if defined(FEAT_MOUSE_DEC)
  /*
   * When the DEC mouse has been pressed but not yet released we enable
!  * automatic querys for the mouse position.
   */
  EXTERN int	WantQueryMouse INIT(= FALSE);
  # endif
--- 426,432 ----
  # if defined(FEAT_MOUSE_DEC)
  /*
   * When the DEC mouse has been pressed but not yet released we enable
!  * automatic queries for the mouse position.
   */
  EXTERN int	WantQueryMouse INIT(= FALSE);
  # endif
*** ../vim-8.1.0988/src/gui_gtk_f.c	2019-02-17 17:44:36.207875527 +0100
--- src/gui_gtk_f.c	2019-03-02 09:59:25.007064462 +0100
***************
*** 561,567 ****
  	     * gtk_widget_size_allocate() in advance with a well-posed
  	     * allocation for a given child widget in order to set a
  	     * certain private GtkWidget variable, called
! 	     * widget->priv->alloc_need, to the proper value; othewise,
  	     * gtk_widget_draw() fails and the relevant scrollbar won't
  	     * appear on the screen.
  	     *
--- 561,567 ----
  	     * gtk_widget_size_allocate() in advance with a well-posed
  	     * allocation for a given child widget in order to set a
  	     * certain private GtkWidget variable, called
! 	     * widget->priv->alloc_need, to the proper value; otherwise,
  	     * gtk_widget_draw() fails and the relevant scrollbar won't
  	     * appear on the screen.
  	     *
*** ../vim-8.1.0988/src/gui_gtk_x11.c	2019-02-17 17:44:36.211875510 +0100
--- src/gui_gtk_x11.c	2019-03-02 09:59:25.007064462 +0100
***************
*** 7015,7021 ****
  		 (double)(MIN(height, SIGN_HEIGHT))) < 1.15)
  	    {
  		/* Change the aspect ratio by at most 15% to fill the
! 		 * available space completly. */
  		height = (double)SIGN_HEIGHT * SIGN_ASPECT / aspect;
  		height = MIN(height, SIGN_HEIGHT);
  	    }
--- 7015,7021 ----
  		 (double)(MIN(height, SIGN_HEIGHT))) < 1.15)
  	    {
  		/* Change the aspect ratio by at most 15% to fill the
! 		 * available space completely. */
  		height = (double)SIGN_HEIGHT * SIGN_ASPECT / aspect;
  		height = MIN(height, SIGN_HEIGHT);
  	    }
*** ../vim-8.1.0988/src/gui_mac.c	2019-01-24 15:04:44.674887811 +0100
--- src/gui_mac.c	2019-03-02 09:59:25.007064462 +0100
***************
*** 1342,1351 ****
      }
      error = AEInstallEventHandler('KAHL', 'MOD ',
  		    NewAEEventHandlerUPP(Handle_KAHL_MOD_AE), 0, false);
-     if (error)
-     {
- 	return error;
-     }
  #endif
  
      return error;
--- 1342,1347 ----
*** ../vim-8.1.0988/src/ops.c	2019-02-15 21:06:05.342289715 +0100
--- src/ops.c	2019-03-02 09:59:25.007064462 +0100
***************
*** 5402,5408 ****
      linenr_T		amount = Prenum1;
  
     // do_addsub() might trigger re-evaluation of 'foldexpr' halfway, when the
!    // buffer is not completly updated yet. Postpone updating folds until before
     // the call to changed_lines().
  #ifdef FEAT_FOLDING
     disable_fold_update++;
--- 5402,5408 ----
      linenr_T		amount = Prenum1;
  
     // do_addsub() might trigger re-evaluation of 'foldexpr' halfway, when the
!    // buffer is not completely updated yet. Postpone updating folds until before
     // the call to changed_lines().
  #ifdef FEAT_FOLDING
     disable_fold_update++;
*** ../vim-8.1.0988/src/option.h	2019-02-17 17:44:36.215875493 +0100
--- src/option.h	2019-03-02 09:59:25.007064462 +0100
***************
*** 193,200 ****
  #define SHM_WRI		'w'		/* "[w]" instead of "written" */
  #define SHM_A		"rmfixlnw"	/* represented by 'a' flag */
  #define SHM_WRITE	'W'		/* don't use "written" at all */
! #define SHM_TRUNC	't'		/* trunctate file messages */
! #define SHM_TRUNCALL	'T'		/* trunctate all messages */
  #define SHM_OVER	'o'		/* overwrite file messages */
  #define SHM_OVERALL	'O'		/* overwrite more messages */
  #define SHM_SEARCH	's'		/* no search hit bottom messages */
--- 193,200 ----
  #define SHM_WRI		'w'		/* "[w]" instead of "written" */
  #define SHM_A		"rmfixlnw"	/* represented by 'a' flag */
  #define SHM_WRITE	'W'		/* don't use "written" at all */
! #define SHM_TRUNC	't'		/* truncate file messages */
! #define SHM_TRUNCALL	'T'		/* truncate all messages */
  #define SHM_OVER	'o'		/* overwrite file messages */
  #define SHM_OVERALL	'O'		/* overwrite more messages */
  #define SHM_SEARCH	's'		/* no search hit bottom messages */
*** ../vim-8.1.0988/src/os_unix.c	2019-02-26 17:03:49.845487937 +0100
--- src/os_unix.c	2019-03-02 09:59:25.007064462 +0100
***************
*** 6418,6424 ****
      int		shell_style = STYLE_ECHO;
      int		check_spaces;
      static int	did_find_nul = FALSE;
!     int		ampersent = FALSE;
  		/* vimglob() function to define for Posix shell */
      static char *sh_vimglob_func = "vimglob() { while [ $# -ge 1 ]; do echo \"$1\"; shift; done }; vimglob >";
  
--- 6418,6424 ----
      int		shell_style = STYLE_ECHO;
      int		check_spaces;
      static int	did_find_nul = FALSE;
!     int		ampersand = FALSE;
  		/* vimglob() function to define for Posix shell */
      static char *sh_vimglob_func = "vimglob() { while [ $# -ge 1 ]; do echo \"$1\"; shift; done }; vimglob >";
  
***************
*** 6535,6541 ****
  	    --p;
  	if (*p == '&')				/* remove trailing '&' */
  	{
! 	    ampersent = TRUE;
  	    *p = ' ';
  	}
  	STRCAT(command, ">");
--- 6535,6541 ----
  	    --p;
  	if (*p == '&')				/* remove trailing '&' */
  	{
! 	    ampersand = TRUE;
  	    *p = ' ';
  	}
  	STRCAT(command, ">");
***************
*** 6604,6610 ****
  	}
      if (flags & EW_SILENT)
  	show_shell_mess = FALSE;
!     if (ampersent)
  	STRCAT(command, "&");		/* put the '&' after the redirection */
  
      /*
--- 6604,6610 ----
  	}
      if (flags & EW_SILENT)
  	show_shell_mess = FALSE;
!     if (ampersand)
  	STRCAT(command, "&");		/* put the '&' after the redirection */
  
      /*
***************
*** 6630,6636 ****
  
      /* When running in the background, give it some time to create the temp
       * file, but don't wait for it to finish. */
!     if (ampersent)
  	mch_delay(10L, TRUE);
  
      extra_shell_arg = NULL;		/* cleanup */
--- 6630,6636 ----
  
      /* When running in the background, give it some time to create the temp
       * file, but don't wait for it to finish. */
!     if (ampersand)
  	mch_delay(10L, TRUE);
  
      extra_shell_arg = NULL;		/* cleanup */
*** ../vim-8.1.0988/src/os_win32.c	2019-02-26 17:03:49.845487937 +0100
--- src/os_win32.c	2019-03-02 09:59:25.011064430 +0100
***************
*** 2646,2652 ****
      if (cterm_normal_bg_color == 0)
  	cterm_normal_bg_color = ((g_attrCurrent >> 4) & 0xf) + 1;
  
!     // Fg and Bg color index nunmber at startup
      g_color_index_fg = g_attrDefault & 0xf;
      g_color_index_bg = (g_attrDefault >> 4) & 0xf;
  
--- 2646,2652 ----
      if (cterm_normal_bg_color == 0)
  	cterm_normal_bg_color = ((g_attrCurrent >> 4) & 0xf) + 1;
  
!     // Fg and Bg color index number at startup
      g_color_index_fg = g_attrDefault & 0xf;
      g_color_index_bg = (g_attrDefault >> 4) & 0xf;
  
***************
*** 4210,4217 ****
  	    (LPSTARTUPINFOW)si,	/* Startup information */
  	    pi);			/* Process information */
  	vim_free(wcmd);
! 	if (wcwd != NULL)
! 	    vim_free(wcwd);
  	return ret;
      }
  fallback:
--- 4210,4216 ----
  	    (LPSTARTUPINFOW)si,	/* Startup information */
  	    pi);			/* Process information */
  	vim_free(wcmd);
! 	vim_free(wcwd);
  	return ret;
      }
  fallback:
***************
*** 5312,5319 ****
  			*((WCHAR*)gap->ga_data + gap->ga_len++) = wval[n];
  		    *((WCHAR*)gap->ga_data + gap->ga_len++) = L'\0';
  		}
! 		if (wkey != NULL) vim_free(wkey);
! 		if (wval != NULL) vim_free(wval);
  	    }
  	}
      }
--- 5311,5318 ----
  			*((WCHAR*)gap->ga_data + gap->ga_len++) = wval[n];
  		    *((WCHAR*)gap->ga_data + gap->ga_len++) = L'\0';
  		}
! 		vim_free(wkey);
! 		vim_free(wval);
  	    }
  	}
      }
*** ../vim-8.1.0988/src/popupmnu.c	2019-01-30 21:40:58.943219829 +0100
--- src/popupmnu.c	2019-03-02 09:59:25.011064430 +0100
***************
*** 405,411 ****
      char_u	*p = NULL;
      int		totwidth, width, w;
      int		thumb_pos = 0;
!     int		thumb_heigth = 1;
      int		round;
      int		n;
  
--- 405,411 ----
      char_u	*p = NULL;
      int		totwidth, width, w;
      int		thumb_pos = 0;
!     int		thumb_height = 1;
      int		round;
      int		n;
  
***************
*** 423,432 ****
  
      if (pum_scrollbar)
      {
! 	thumb_heigth = pum_height * pum_height / pum_size;
! 	if (thumb_heigth == 0)
! 	    thumb_heigth = 1;
! 	thumb_pos = (pum_first * (pum_height - thumb_heigth)
  			    + (pum_size - pum_height) / 2)
  						    / (pum_size - pum_height);
      }
--- 423,432 ----
  
      if (pum_scrollbar)
      {
! 	thumb_height = pum_height * pum_height / pum_size;
! 	if (thumb_height == 0)
! 	    thumb_height = 1;
! 	thumb_pos = (pum_first * (pum_height - thumb_height)
  			    + (pum_size - pum_height) / 2)
  						    / (pum_size - pum_height);
      }
***************
*** 600,611 ****
  #ifdef FEAT_RIGHTLEFT
  	    if (curwin->w_p_rl)
  		screen_putchar(' ', row, pum_col - pum_width,
! 			i >= thumb_pos && i < thumb_pos + thumb_heigth
  						  ? attr_thumb : attr_scroll);
  	    else
  #endif
  		screen_putchar(' ', row, pum_col + pum_width,
! 			i >= thumb_pos && i < thumb_pos + thumb_heigth
  						  ? attr_thumb : attr_scroll);
  	}
  
--- 600,611 ----
  #ifdef FEAT_RIGHTLEFT
  	    if (curwin->w_p_rl)
  		screen_putchar(' ', row, pum_col - pum_width,
! 			i >= thumb_pos && i < thumb_pos + thumb_height
  						  ? attr_thumb : attr_scroll);
  	    else
  #endif
  		screen_putchar(' ', row, pum_col + pum_width,
! 			i >= thumb_pos && i < thumb_pos + thumb_height
  						  ? attr_thumb : attr_scroll);
  	}
  
*** ../vim-8.1.0988/src/regexp.c	2019-02-28 06:24:49.788775847 +0100
--- src/regexp.c	2019-03-02 09:59:25.011064430 +0100
***************
*** 6457,6463 ****
  	}
  	else if (op == RE_LNUM || op == RE_COL || op == RE_VCOL)
  	{
! 	    /* one int plus comperator */
  	    fprintf(f, " count %ld", OPERAND_MIN(s));
  	    s += 5;
  	}
--- 6457,6463 ----
  	}
  	else if (op == RE_LNUM || op == RE_COL || op == RE_VCOL)
  	{
! 	    /* one int plus comparator */
  	    fprintf(f, " count %ld", OPERAND_MIN(s));
  	    s += 5;
  	}
*** ../vim-8.1.0988/src/ui.c	2019-02-17 17:44:36.223875455 +0100
--- src/ui.c	2019-03-02 09:59:25.011064430 +0100
***************
*** 1738,1744 ****
      if (!clip_did_set_selection)
      {
  	/* Updating postponed, so that accessing the system clipboard won't
! 	 * hang Vim when accessing it many times (e.g. on a :g comand). */
  	if ((cbd == &clip_plus && (clip_unnamed_saved & CLIP_UNNAMED_PLUS))
  		|| (cbd == &clip_star && (clip_unnamed_saved & CLIP_UNNAMED)))
  	{
--- 1738,1744 ----
      if (!clip_did_set_selection)
      {
  	/* Updating postponed, so that accessing the system clipboard won't
! 	 * hang Vim when accessing it many times (e.g. on a :g command). */
  	if ((cbd == &clip_plus && (clip_unnamed_saved & CLIP_UNNAMED_PLUS))
  		|| (cbd == &clip_star && (clip_unnamed_saved & CLIP_UNNAMED)))
  	{
*** ../vim-8.1.0988/src/version.c	2019-03-02 07:57:12.236395037 +0100
--- src/version.c	2019-03-02 10:00:49.182459575 +0100
***************
*** 41,47 ****
  {
      /*
       * Construct the long version string.  Necessary because
!      * VAX C can't catenate strings in the preprocessor.
       */
      strcpy(longVersion, VIM_VERSION_LONG_DATE);
      strcat(longVersion, __DATE__);
--- 41,47 ----
  {
      /*
       * Construct the long version string.  Necessary because
!      * VAX C can't concatenate strings in the preprocessor.
       */
      strcpy(longVersion, VIM_VERSION_LONG_DATE);
      strcat(longVersion, __DATE__);
*** ../vim-8.1.0988/src/version.c	2019-03-02 07:57:12.236395037 +0100
--- src/version.c	2019-03-02 10:00:49.182459575 +0100
***************
*** 781,782 ****
--- 781,784 ----
  {   /* Add new patch number below this line */
+ /**/
+     989,
  /**/

-- 
Due knot trussed yore spell chequer two fined awl miss steaks.

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