summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0393
blob: 2bf27d593abb54ec56883bffb60ba35cb9eb6ff7 (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
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0393
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.0393
Solution:   Add "iblank", "iwhiteall" and "iwhiteeol" to 'diffopt'.
Files:	    src/diff.c, src/testdir/test_diffmode.vim,
            src/testdir/dumps/Test_diff_17.dump,
            src/testdir/dumps/Test_diff_18.dump,
            src/testdir/dumps/Test_diff_19.dump,
            src/testdir/dumps/Test_diff_20.dump


*** ../vim-8.1.0392/src/diff.c	2018-09-13 15:33:39.601712271 +0200
--- src/diff.c	2018-09-15 18:52:00.815797976 +0200
***************
*** 24,36 ****
  static int	diff_busy = FALSE;	/* ex_diffgetput() is busy */
  
  /* flags obtained from the 'diffopt' option */
! #define DIFF_FILLER	1	// display filler lines
! #define DIFF_ICASE	2	// ignore case
! #define DIFF_IWHITE	4	// ignore change in white space
! #define DIFF_HORIZONTAL	8	// horizontal splits
! #define DIFF_VERTICAL	16	// vertical splits
! #define DIFF_HIDDEN_OFF	32	// diffoff when hidden
! #define DIFF_INTERNAL	64	// use internal xdiff algorithm
  static int	diff_flags = DIFF_INTERNAL | DIFF_FILLER;
  
  static long diff_algorithm = 0;
--- 24,40 ----
  static int	diff_busy = FALSE;	/* ex_diffgetput() is busy */
  
  /* flags obtained from the 'diffopt' option */
! #define DIFF_FILLER	0x001	// display filler lines
! #define DIFF_IBLANK	0x002	// ignore empty lines
! #define DIFF_ICASE	0x004	// ignore case
! #define DIFF_IWHITE	0x008	// ignore change in white space
! #define DIFF_IWHITEALL	0x010	// ignore all white space changes
! #define DIFF_IWHITEEOL	0x020	// ignore change in white space at EOL
! #define DIFF_HORIZONTAL	0x040	// horizontal splits
! #define DIFF_VERTICAL	0x080	// vertical splits
! #define DIFF_HIDDEN_OFF	0x100	// diffoff when hidden
! #define DIFF_INTERNAL	0x200	// use internal xdiff algorithm
! #define ALL_WHITE_DIFF (DIFF_IWHITE | DIFF_IWHITEALL | DIFF_IWHITEEOL)
  static int	diff_flags = DIFF_INTERNAL | DIFF_FILLER;
  
  static long diff_algorithm = 0;
***************
*** 1050,1055 ****
--- 1054,1065 ----
  
      if (diff_flags & DIFF_IWHITE)
  	param.flags |= XDF_IGNORE_WHITESPACE_CHANGE;
+     if (diff_flags & DIFF_IWHITEALL)
+ 	param.flags |= XDF_IGNORE_WHITESPACE;
+     if (diff_flags & DIFF_IWHITEEOL)
+ 	param.flags |= XDF_IGNORE_WHITESPACE_AT_EOL;
+     if (diff_flags & DIFF_IBLANK)
+ 	param.flags |= XDF_IGNORE_BLANK_LINES;
  
      emit_cfg.ctxlen = 0; // don't need any diff_context here
      emit_cb.priv = &diffio->dio_diff;
***************
*** 1106,1112 ****
  	// Build the diff command and execute it.  Always use -a, binary
  	// differences are of no use.  Ignore errors, diff returns
  	// non-zero when differences have been found.
! 	vim_snprintf((char *)cmd, len, "diff %s%s%s%s%s %s",
  		diff_a_works == FALSE ? "" : "-a ",
  #if defined(MSWIN)
  		diff_bin_works == TRUE ? "--binary " : "",
--- 1116,1122 ----
  	// Build the diff command and execute it.  Always use -a, binary
  	// differences are of no use.  Ignore errors, diff returns
  	// non-zero when differences have been found.
! 	vim_snprintf((char *)cmd, len, "diff %s%s%s%s%s%s%s%s %s",
  		diff_a_works == FALSE ? "" : "-a ",
  #if defined(MSWIN)
  		diff_bin_works == TRUE ? "--binary " : "",
***************
*** 1114,1119 ****
--- 1124,1132 ----
  		"",
  #endif
  		(diff_flags & DIFF_IWHITE) ? "-b " : "",
+ 		(diff_flags & DIFF_IWHITEALL) ? "-w " : "",
+ 		(diff_flags & DIFF_IWHITEEOL) ? "-Z " : "",
+ 		(diff_flags & DIFF_IBLANK) ? "-B " : "",
  		(diff_flags & DIFF_ICASE) ? "-i " : "",
  		tmp_orig, tmp_new);
  	append_redir(cmd, (int)len, p_srr, tmp_diff);
***************
*** 1946,1962 ****
      char_u	*p1, *p2;
      int		l;
  
!     if ((diff_flags & (DIFF_ICASE | DIFF_IWHITE)) == 0)
  	return STRCMP(s1, s2);
!     if ((diff_flags & DIFF_ICASE) && !(diff_flags & DIFF_IWHITE))
  	return MB_STRICMP(s1, s2);
  
-     /* Ignore white space changes and possibly ignore case. */
      p1 = s1;
      p2 = s2;
      while (*p1 != NUL && *p2 != NUL)
      {
! 	if (VIM_ISWHITE(*p1) && VIM_ISWHITE(*p2))
  	{
  	    p1 = skipwhite(p1);
  	    p2 = skipwhite(p2);
--- 1959,1983 ----
      char_u	*p1, *p2;
      int		l;
  
!     if ((diff_flags & DIFF_IBLANK)
! 	    && (*skipwhite(s1) == NUL || *skipwhite(s2) == NUL))
! 	return 0;
! 
!     if ((diff_flags & (DIFF_ICASE | ALL_WHITE_DIFF)) == 0)
  	return STRCMP(s1, s2);
!     if ((diff_flags & DIFF_ICASE) && !(diff_flags & ALL_WHITE_DIFF))
  	return MB_STRICMP(s1, s2);
  
      p1 = s1;
      p2 = s2;
+ 
+     // Ignore white space changes and possibly ignore case.
      while (*p1 != NUL && *p2 != NUL)
      {
! 	if (((diff_flags & DIFF_IWHITE)
! 		    && VIM_ISWHITE(*p1) && VIM_ISWHITE(*p2))
! 		|| ((diff_flags & DIFF_IWHITEALL)
! 		    && (VIM_ISWHITE(*p1) || VIM_ISWHITE(*p2))))
  	{
  	    p1 = skipwhite(p1);
  	    p2 = skipwhite(p2);
***************
*** 1970,1976 ****
  	}
      }
  
!     /* Ignore trailing white space. */
      p1 = skipwhite(p1);
      p2 = skipwhite(p2);
      if (*p1 != NUL || *p2 != NUL)
--- 1991,1997 ----
  	}
      }
  
!     // Ignore trailing white space.
      p1 = skipwhite(p1);
      p2 = skipwhite(p2);
      if (*p1 != NUL || *p2 != NUL)
***************
*** 2142,2152 ****
--- 2163,2188 ----
  	    p += 8;
  	    diff_context_new = getdigits(&p);
  	}
+ 	else if (STRNCMP(p, "iblank", 6) == 0)
+ 	{
+ 	    p += 6;
+ 	    diff_flags_new |= DIFF_IBLANK;
+ 	}
  	else if (STRNCMP(p, "icase", 5) == 0)
  	{
  	    p += 5;
  	    diff_flags_new |= DIFF_ICASE;
  	}
+ 	else if (STRNCMP(p, "iwhiteall", 9) == 0)
+ 	{
+ 	    p += 9;
+ 	    diff_flags_new |= DIFF_IWHITEALL;
+ 	}
+ 	else if (STRNCMP(p, "iwhiteeol", 9) == 0)
+ 	{
+ 	    p += 9;
+ 	    diff_flags_new |= DIFF_IWHITEEOL;
+ 	}
  	else if (STRNCMP(p, "iwhite", 6) == 0)
  	{
  	    p += 6;
***************
*** 2315,2323 ****
  	    si_org = si_new = 0;
  	    while (line_org[si_org] != NUL)
  	    {
! 		if ((diff_flags & DIFF_IWHITE)
! 			&& VIM_ISWHITE(line_org[si_org])
! 			&& VIM_ISWHITE(line_new[si_new]))
  		{
  		    si_org = (int)(skipwhite(line_org + si_org) - line_org);
  		    si_new = (int)(skipwhite(line_new + si_new) - line_new);
--- 2351,2362 ----
  	    si_org = si_new = 0;
  	    while (line_org[si_org] != NUL)
  	    {
! 		if (((diff_flags & DIFF_IWHITE)
! 			    && VIM_ISWHITE(line_org[si_org])
! 					      && VIM_ISWHITE(line_new[si_new]))
! 			|| ((diff_flags & DIFF_IWHITEALL)
! 			    && (VIM_ISWHITE(line_org[si_org])
! 					    || VIM_ISWHITE(line_new[si_new]))))
  		{
  		    si_org = (int)(skipwhite(line_org + si_org) - line_org);
  		    si_new = (int)(skipwhite(line_new + si_new) - line_new);
***************
*** 2351,2359 ****
  		while (ei_org >= *startp && ei_new >= si_new
  						&& ei_org >= 0 && ei_new >= 0)
  		{
! 		    if ((diff_flags & DIFF_IWHITE)
! 			    && VIM_ISWHITE(line_org[ei_org])
! 			    && VIM_ISWHITE(line_new[ei_new]))
  		    {
  			while (ei_org >= *startp
  					     && VIM_ISWHITE(line_org[ei_org]))
--- 2390,2401 ----
  		while (ei_org >= *startp && ei_new >= si_new
  						&& ei_org >= 0 && ei_new >= 0)
  		{
! 		    if (((diff_flags & DIFF_IWHITE)
! 				&& VIM_ISWHITE(line_org[ei_org])
! 					      && VIM_ISWHITE(line_new[ei_new]))
! 			    || ((diff_flags & DIFF_IWHITEALL)
! 				&& (VIM_ISWHITE(line_org[ei_org])
! 					    || VIM_ISWHITE(line_new[ei_new]))))
  		    {
  			while (ei_org >= *startp
  					     && VIM_ISWHITE(line_org[ei_org]))
*** ../vim-8.1.0392/src/testdir/test_diffmode.vim	2018-09-13 13:03:08.228724142 +0200
--- src/testdir/test_diffmode.vim	2018-09-15 19:02:43.814040268 +0200
***************
*** 671,686 ****
    bwipe!
  endfunc
  
! func WriteDiffFiles(list1, list2)
    call writefile(a:list1, 'Xfile1')
    call writefile(a:list2, 'Xfile2')
  endfunc
  
! " Verify a screendump with both the external and external diff.
  func VerifyBoth(buf, dumpfile, extra)
-   call term_sendkeys(a:buf, ":diffupdate!\<cr>")
    " trailing : for leaving the cursor on the command line
!   for cmd in [":set diffopt=filler" . a:extra . "\<cr>:", ":set diffopt+=internal\<cr>:"]
      call term_sendkeys(a:buf, cmd)
      if VerifyScreenDump(a:buf, a:dumpfile, {}, cmd =~ 'internal' ? 'internal' : 'external')
        break " don't let the next iteration overwrite the "failed" file.
--- 671,688 ----
    bwipe!
  endfunc
  
! func WriteDiffFiles(buf, list1, list2)
    call writefile(a:list1, 'Xfile1')
    call writefile(a:list2, 'Xfile2')
+   if a:buf
+     call term_sendkeys(a:buf, ":checktime\<CR>")
+   endif
  endfunc
  
! " Verify a screendump with both the internal and external diff.
  func VerifyBoth(buf, dumpfile, extra)
    " trailing : for leaving the cursor on the command line
!   for cmd in [":set diffopt=filler" . a:extra . "\<CR>:", ":set diffopt+=internal\<CR>:"]
      call term_sendkeys(a:buf, cmd)
      if VerifyScreenDump(a:buf, a:dumpfile, {}, cmd =~ 'internal' ? 'internal' : 'external')
        break " don't let the next iteration overwrite the "failed" file.
***************
*** 688,693 ****
--- 690,703 ----
    endfor
  endfunc
  
+ " Verify a screendump with the internal diff only.
+ func VerifyInternal(buf, dumpfile, extra)
+   call term_sendkeys(a:buf, ":diffupdate!\<CR>")
+   " trailing : for leaving the cursor on the command line
+   call term_sendkeys(a:buf, ":set diffopt=internal,filler" . a:extra . "\<CR>:")
+   call VerifyScreenDump(a:buf, a:dumpfile, {})
+ endfunc
+ 
  func Test_diff_screen()
    if !CanRunVimInTerminal() || !has('menu')
      return
***************
*** 697,732 ****
    call delete('.Xfile2.swp')
  
    " Test 1: Add a line in beginning of file 2
!   call WriteDiffFiles([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
    let buf = RunVimInTerminal('-d Xfile1 Xfile2', {})
    " Set autoread mode, ,so that Vim won't complain once we re-write the test
    " files
!   call term_sendkeys(buf, ":set autoread\<cr>\<c-w>w:set autoread\<cr>\<c-w>w")
  
    call VerifyBoth(buf, 'Test_diff_01', '')
  
    " Test 2: Add a line in beginning of file 1
!   call WriteDiffFiles([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
    call VerifyBoth(buf, 'Test_diff_02', '')
  
    " Test 3: Add a line at the end of file 2
!   call WriteDiffFiles([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])
    call VerifyBoth(buf, 'Test_diff_03', '')
  
    " Test 4: Add a line at the end of file 1
!   call WriteDiffFiles([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
    call VerifyBoth(buf, 'Test_diff_04', '')
  
    " Test 5: Add a line in the middle of file 2, remove on at the end of file 1
!   call WriteDiffFiles([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], [1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10])
    call VerifyBoth(buf, 'Test_diff_05', '')
  
    " Test 6: Add a line in the middle of file 1, remove on at the end of file 2
!   call WriteDiffFiles([1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])
    call VerifyBoth(buf, 'Test_diff_06', '')
  
    " Test 7 - 9: Test normal/patience/histogram diff algorithm
!   call WriteDiffFiles(['#include <stdio.h>', '', '// Frobs foo heartily', 'int frobnitz(int foo)', '{',
        \ '    int i;', '    for(i = 0; i < 10; i++)', '    {', '        printf("Your answer is: ");',
        \ '        printf("%d\n", foo);', '    }', '}', '', 'int fact(int n)', '{', '    if(n > 1)', '    {',
        \ '        return fact(n-1) * n;', '    }', '    return 1;', '}', '', 'int main(int argc, char **argv)',
--- 707,742 ----
    call delete('.Xfile2.swp')
  
    " Test 1: Add a line in beginning of file 2
!   call WriteDiffFiles(0, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
    let buf = RunVimInTerminal('-d Xfile1 Xfile2', {})
    " Set autoread mode, ,so that Vim won't complain once we re-write the test
    " files
!   call term_sendkeys(buf, ":set autoread\<CR>\<c-w>w:set autoread\<CR>\<c-w>w")
  
    call VerifyBoth(buf, 'Test_diff_01', '')
  
    " Test 2: Add a line in beginning of file 1
!   call WriteDiffFiles(buf, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
    call VerifyBoth(buf, 'Test_diff_02', '')
  
    " Test 3: Add a line at the end of file 2
!   call WriteDiffFiles(buf, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])
    call VerifyBoth(buf, 'Test_diff_03', '')
  
    " Test 4: Add a line at the end of file 1
!   call WriteDiffFiles(buf, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
    call VerifyBoth(buf, 'Test_diff_04', '')
  
    " Test 5: Add a line in the middle of file 2, remove on at the end of file 1
!   call WriteDiffFiles(buf, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], [1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10])
    call VerifyBoth(buf, 'Test_diff_05', '')
  
    " Test 6: Add a line in the middle of file 1, remove on at the end of file 2
!   call WriteDiffFiles(buf, [1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])
    call VerifyBoth(buf, 'Test_diff_06', '')
  
    " Test 7 - 9: Test normal/patience/histogram diff algorithm
!   call WriteDiffFiles(buf, ['#include <stdio.h>', '', '// Frobs foo heartily', 'int frobnitz(int foo)', '{',
        \ '    int i;', '    for(i = 0; i < 10; i++)', '    {', '        printf("Your answer is: ");',
        \ '        printf("%d\n", foo);', '    }', '}', '', 'int fact(int n)', '{', '    if(n > 1)', '    {',
        \ '        return fact(n-1) * n;', '    }', '    return 1;', '}', '', 'int main(int argc, char **argv)',
***************
*** 748,754 ****
  
    " Test 10-11: normal/indent-heuristic
    call term_sendkeys(buf, ":set diffopt&vim\<cr>")
!   call WriteDiffFiles(['', '  def finalize(values)', '', '    values.each do |v|', '      v.finalize', '    end'],
        \ ['', '  def finalize(values)', '', '    values.each do |v|', '      v.prepare', '    end', '',
        \ '    values.each do |v|', '      v.finalize', '    end'])
    call term_sendkeys(buf, ":diffupdate!\<cr>")
--- 758,764 ----
  
    " Test 10-11: normal/indent-heuristic
    call term_sendkeys(buf, ":set diffopt&vim\<cr>")
!   call WriteDiffFiles(buf, ['', '  def finalize(values)', '', '    values.each do |v|', '      v.finalize', '    end'],
        \ ['', '  def finalize(values)', '', '    values.each do |v|', '      v.prepare', '    end', '',
        \ '    values.each do |v|', '      v.finalize', '    end'])
    call term_sendkeys(buf, ":diffupdate!\<cr>")
***************
*** 759,777 ****
    call VerifyScreenDump(buf, 'Test_diff_11', {})
  
    " Test 12: diff the same file
!   call WriteDiffFiles([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
    call VerifyBoth(buf, 'Test_diff_12', '')
  
    " Test 13: diff an empty file
!   call WriteDiffFiles([], [])
    call VerifyBoth(buf, 'Test_diff_13', '')
  
    " Test 14: test diffopt+=icase
!   call WriteDiffFiles(['a', 'b', 'cd'], ['A', 'b', 'cDe'])
    call VerifyBoth(buf, 'Test_diff_14', " diffopt+=filler diffopt+=icase")
  
    " Test 15-16: test diffopt+=iwhite
!   call WriteDiffFiles(['int main()', '{', '   printf("Hello, World!");', '   return 0;', '}'],
        \ ['int main()', '{', '   if (0)', '   {', '      printf("Hello, World!");', '      return 0;', '   }', '}'])
    call term_sendkeys(buf, ":diffupdate!\<cr>")
    call term_sendkeys(buf, ":set diffopt&vim diffopt+=filler diffopt+=iwhite\<cr>")
--- 769,787 ----
    call VerifyScreenDump(buf, 'Test_diff_11', {})
  
    " Test 12: diff the same file
!   call WriteDiffFiles(buf, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
    call VerifyBoth(buf, 'Test_diff_12', '')
  
    " Test 13: diff an empty file
!   call WriteDiffFiles(buf, [], [])
    call VerifyBoth(buf, 'Test_diff_13', '')
  
    " Test 14: test diffopt+=icase
!   call WriteDiffFiles(buf, ['a', 'b', 'cd'], ['A', 'b', 'cDe'])
    call VerifyBoth(buf, 'Test_diff_14', " diffopt+=filler diffopt+=icase")
  
    " Test 15-16: test diffopt+=iwhite
!   call WriteDiffFiles(buf, ['int main()', '{', '   printf("Hello, World!");', '   return 0;', '}'],
        \ ['int main()', '{', '   if (0)', '   {', '      printf("Hello, World!");', '      return 0;', '   }', '}'])
    call term_sendkeys(buf, ":diffupdate!\<cr>")
    call term_sendkeys(buf, ":set diffopt&vim diffopt+=filler diffopt+=iwhite\<cr>")
***************
*** 779,784 ****
--- 789,810 ----
    call term_sendkeys(buf, ":set diffopt+=internal\<cr>")
    call VerifyScreenDump(buf, 'Test_diff_16', {})
  
+   " Test 17: test diffopt+=iblank
+   call WriteDiffFiles(buf, ['a', ' ', 'cd', 'ef', 'xxx'], ['a', 'cd', '', 'ef', 'yyy'])
+   call VerifyInternal(buf, 'Test_diff_17', " diffopt+=iblank")
+ 
+   " Test 18: test diffopt+=iblank,iwhite / iwhiteall / iwhiteeol
+   call VerifyInternal(buf, 'Test_diff_18', " diffopt+=iblank,iwhite")
+   call VerifyInternal(buf, 'Test_diff_18', " diffopt+=iblank,iwhiteall")
+   call VerifyInternal(buf, 'Test_diff_18', " diffopt+=iblank,iwhiteeol")
+ 
+   " Test 19: test diffopt+=iwhiteeol
+   call WriteDiffFiles(buf, ['a ', 'x', 'cd', 'ef', 'xx  xx', 'foo', 'bar'], ['a', 'x', 'c d', ' ef', 'xx xx', 'foo', '', 'bar'])
+   call VerifyInternal(buf, 'Test_diff_19', " diffopt+=iwhiteeol")
+ 
+   " Test 19: test diffopt+=iwhiteall
+   call VerifyInternal(buf, 'Test_diff_20', " diffopt+=iwhiteall")
+ 
    " clean up
    call StopVimInTerminal(buf)
    call delete('Xfile1')
*** ../vim-8.1.0392/src/testdir/dumps/Test_diff_17.dump	2018-09-15 19:15:54.443272696 +0200
--- src/testdir/dumps/Test_diff_17.dump	2018-09-15 17:55:58.742090613 +0200
***************
*** 0 ****
--- 1,20 ----
+ | +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@34||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34
+ | +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|d| @32||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|d| @32
+ | +0#0000e05#a8a8a8255@1|e+0#0000000#ffffff0|f| @32||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34
+ | +0#0000e05#a8a8a8255@1|x+2#0000000#ff404010@2| +0&#ffd7ff255@31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|e+0#0000000#ffffff0|f| @32
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|y+2#0000000#ff404010@2| +0&#ffd7ff255@31
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ |X+3#0000000&|f|i|l|e|1| @12|1|,|1| @11|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|A|l@1
+ |:+0&&> @73
*** ../vim-8.1.0392/src/testdir/dumps/Test_diff_18.dump	2018-09-15 19:15:54.447272663 +0200
--- src/testdir/dumps/Test_diff_18.dump	2018-09-15 18:52:17.627640956 +0200
***************
*** 0 ****
--- 1,20 ----
+ | +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|d| @32
+ | +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|d| @32||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34
+ | +0#0000e05#a8a8a8255@1|e+0#0000000#ffffff0|f| @32||+1&&| +0#0000e05#a8a8a8255@1|e+0#0000000#ffffff0|f| @32
+ | +0#0000e05#a8a8a8255@1|x+2#0000000#ff404010@2| +0&#ffd7ff255@31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|y+2#0000000#ff404010@2| +0&#ffd7ff255@31
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ |X+3#0000000&|f|i|l|e|1| @12|1|,|1| @11|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|A|l@1
+ |:+0&&> @73
*** ../vim-8.1.0392/src/testdir/dumps/Test_diff_19.dump	2018-09-15 19:15:54.451272630 +0200
--- src/testdir/dumps/Test_diff_19.dump	2018-09-15 19:02:49.693989182 +0200
***************
*** 0 ****
--- 1,20 ----
+ | +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|c+0#0000000#ffd7ff255|d| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|c+0#0000000#ffd7ff255| +2&#ff404010|d+0&#ffd7ff255| @31
+ | +0#0000e05#a8a8a8255@1|e+0#0000000#ffd7ff255|f| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +2#0000000#ff404010|e+0&#ffd7ff255|f| @31
+ | +0#0000e05#a8a8a8255@1|x+0#0000000#ffd7ff255@1| | +2&#ff404010|x+0&#ffd7ff255@1| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#ffd7ff255@1| |x@1| @29
+ | +0#0000e05#a8a8a8255@1|f+0#0000000#ffffff0|o@1| @31||+1&&| +0#0000e05#a8a8a8255@1|f+0#0000000#ffffff0|o@1| @31
+ | +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@34
+ | +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0|a|r| @31||+1&&| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0|a|r| @31
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ |X+3#0000000&|f|i|l|e|1| @12|1|,|1| @11|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|A|l@1
+ |:+0&&> @73
*** ../vim-8.1.0392/src/testdir/dumps/Test_diff_20.dump	2018-09-15 19:15:54.455272594 +0200
--- src/testdir/dumps/Test_diff_20.dump	2018-09-15 19:02:50.741980079 +0200
***************
*** 0 ****
--- 1,20 ----
+ | +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|d| @32||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0| |d| @31
+ | +0#0000e05#a8a8a8255@1|e+0#0000000#ffffff0|f| @32||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0|e|f| @31
+ | +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0@1| @1|x@1| @28||+1&&| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0@1| |x@1| @29
+ | +0#0000e05#a8a8a8255@1|f+0#0000000#ffffff0|o@1| @31||+1&&| +0#0000e05#a8a8a8255@1|f+0#0000000#ffffff0|o@1| @31
+ | +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@34
+ | +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0|a|r| @31||+1&&| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0|a|r| @31
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
+ |X+3#0000000&|f|i|l|e|1| @12|1|,|1| @11|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|A|l@1
+ |:+0&&> @73
*** ../vim-8.1.0392/src/version.c	2018-09-15 15:42:36.501547749 +0200
--- src/version.c	2018-09-15 19:05:26.212635237 +0200
***************
*** 796,797 ****
--- 796,799 ----
  {   /* Add new patch number below this line */
+ /**/
+     393,
  /**/

-- 
I'm trying to be an optimist, but I don't think it'll work.

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