@@ -862,6 +862,7 @@ func Test_diff_nomodifiable()
862862endfunc
863863
864864func Test_diff_hlID ()
865+ set diffopt = internal,filler
865866 new
866867 call setline (1 , [1 , 2 , 3 , ' Yz' , ' a dxxg' ,])
867868 diffthis
@@ -904,6 +905,7 @@ func Test_diff_hlID()
904905 call assert_equal (synIDattr (diff_hlID (3 , 1 ), " name" ), " " )
905906
906907 % bwipe!
908+ set diffopt &
907909endfunc
908910
909911func Test_diff_filler ()
@@ -1079,18 +1081,18 @@ func Test_diff_screen()
10791081 call term_sendkeys (buf , " :set diffopt+=algorithm:histogram\<cr> " )
10801082 call VerifyScreenDump (buf , ' Test_diff_09' , {})
10811083
1082- " Test 10-11: normal/ indent-heuristic
1084+ " Test 10-11: with/without indent-heuristic
10831085 call term_sendkeys (buf , " :set diffopt&vim\<cr> " )
10841086 call WriteDiffFiles (buf , [' ' , ' def finalize(values)' , ' ' , ' values.each do |v|' , ' v.finalize' , ' end' ],
10851087 \ [' ' , ' def finalize(values)' , ' ' , ' values.each do |v|' , ' v.prepare' , ' end' , ' ' ,
10861088 \ ' values.each do |v|' , ' v.finalize' , ' end' ])
10871089 call term_sendkeys (buf , " :diffupdate!\<cr> " )
1088- call term_sendkeys (buf , " :set diffopt+=internal\<cr> " )
1089- call VerifyScreenDump (buf , ' Test_diff_10 ' , {})
1090+ call term_sendkeys (buf , " :set diffopt+=internal\<cr> : \<cr> " )
1091+ call VerifyScreenDump (buf , ' Test_diff_11 ' , {})
10901092
10911093 " Leave trailing : at commandline!
1092- call term_sendkeys (buf , " :set diffopt+ =indent-heuristic\<cr> :\<cr> " )
1093- call VerifyScreenDump (buf , ' Test_diff_11 ' , {}, ' one' )
1094+ call term_sendkeys (buf , " :set diffopt- =indent-heuristic\<cr> :\<cr> " )
1095+ call VerifyScreenDump (buf , ' Test_diff_10 ' , {}, ' one' )
10941096 " shouldn't matter, if indent-algorithm comes before or after the algorithm
10951097 call term_sendkeys (buf , " :set diffopt&\<cr> " )
10961098 call term_sendkeys (buf , " :set diffopt+=indent-heuristic,algorithm:patience\<cr> :\<cr> " )
@@ -1331,6 +1333,7 @@ func Test_diff_with_syntax()
13311333 call writefile (lines , ' Xprogram2.c' , ' D' )
13321334
13331335 let lines = << trim END
1336+ set diffopt = internal,filler
13341337 edit Xprogram1.c
13351338 diffsplit Xprogram2.c
13361339 END
@@ -1473,6 +1476,7 @@ func Test_diff_rnu()
14731476 CheckScreendump
14741477
14751478 let content = << trim END
1479+ set diffopt = internal,filler
14761480 call setline (1 , [' a' , ' a' , ' a' , ' y' , ' b' , ' b' , ' b' , ' b' , ' b' ])
14771481 vnew
14781482 call setline (1 , [' a' , ' a' , ' a' , ' x' , ' x' , ' x' , ' b' , ' b' , ' b' , ' b' , ' b' ])
@@ -1560,6 +1564,7 @@ endfunc
15601564" Test for adding/removing lines inside diff chunks, between diff chunks
15611565" and before diff chunks
15621566func Test_diff_modify_chunks ()
1567+ set diffopt = internal,filler
15631568 enew !
15641569 let w2_id = win_getid ()
15651570 call setline (1 , [' a' , ' b' , ' c' , ' d' , ' e' , ' f' , ' g' , ' h' , ' i' ])
@@ -1639,6 +1644,7 @@ func Test_diff_modify_chunks()
16391644 call assert_equal ([' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' ], hl )
16401645
16411646 % bw !
1647+ set diffopt &
16421648endfunc
16431649
16441650func Test_diff_binary ()
@@ -2868,7 +2874,7 @@ func Test_linematch_diff()
28682874 call term_sendkeys (buf , " :set autoread\<CR>\<c-w> w:set autoread\<CR>\<c-w> w" )
28692875
28702876 " enable linematch
2871- call term_sendkeys (buf , " :set diffopt+= linematch:30\<CR> " )
2877+ call term_sendkeys (buf , " :set diffopt=internal,filler, linematch:30\<CR> " )
28722878 call WriteDiffFiles (buf , [' // abc d?' ,
28732879 \ ' // d?' ,
28742880 \ ' // d?' ],
@@ -2896,7 +2902,7 @@ func Test_linematch_diff_iwhite()
28962902 call term_sendkeys (buf , " :set autoread\<CR>\<c-w> w:set autoread\<CR>\<c-w> w" )
28972903
28982904 " setup a diff with 2 files and set linematch:30, with ignore white
2899- call term_sendkeys (buf , " :set diffopt+= linematch:30\<CR> " )
2905+ call term_sendkeys (buf , " :set diffopt=internal,filler, linematch:30\<CR> " )
29002906 call WriteDiffFiles (buf , [' void testFunction () {' ,
29012907 \ ' for (int i = 0; i < 10; i++) {' ,
29022908 \ ' for (int j = 0; j < 10; j++) {' ,
@@ -2923,7 +2929,7 @@ func Test_linematch_diff_grouping()
29232929 call term_sendkeys (buf , " :set autoread\<CR>\<c-w> w:set autoread\<CR>\<c-w> w" )
29242930
29252931 " a diff that would result in multiple groups before grouping optimization
2926- call term_sendkeys (buf , " :set diffopt+= linematch:30\<CR> " )
2932+ call term_sendkeys (buf , " :set diffopt=internal,filler, linematch:30\<CR> " )
29272933 call WriteDiffFiles (buf , [' !A' ,
29282934 \ ' !B' ,
29292935 \ ' !C' ],
@@ -2961,7 +2967,7 @@ func Test_linematch_diff_scroll()
29612967 call term_sendkeys (buf , " :set autoread\<CR>\<c-w> w:set autoread\<CR>\<c-w> w" )
29622968
29632969 " a diff that would result in multiple groups before grouping optimization
2964- call term_sendkeys (buf , " :set diffopt+= linematch:30\<CR> " )
2970+ call term_sendkeys (buf , " :set diffopt=internal,filler, linematch:30\<CR> " )
29652971 call WriteDiffFiles (buf , [' !A' ,
29662972 \ ' !B' ,
29672973 \ ' !C' ],
@@ -2992,7 +2998,7 @@ func Test_linematch_line_limit_exceeded()
29922998 let buf = RunVimInTerminal (' -d Xdifile1 Xdifile2' , {})
29932999 call term_sendkeys (buf , " :set autoread\<CR>\<c-w> w:set autoread\<CR>\<c-w> w" )
29943000
2995- call term_sendkeys (buf , " :set diffopt+= linematch:10\<CR> " )
3001+ call term_sendkeys (buf , " :set diffopt=internal,filler, linematch:10\<CR> " )
29963002 " a diff block will not be aligned with linematch because it's contents
29973003 " exceed 10 lines
29983004 call WriteDiffFiles (buf ,
@@ -3044,7 +3050,7 @@ func Test_linematch_3diffs()
30443050 call term_sendkeys (buf , " 1\<c-w> w:set autoread\<CR> " )
30453051 call term_sendkeys (buf , " 2\<c-w> w:set autoread\<CR> " )
30463052 call term_sendkeys (buf , " 3\<c-w> w:set autoread\<CR> " )
3047- call term_sendkeys (buf , " :set diffopt+= linematch:30\<CR> " )
3053+ call term_sendkeys (buf , " :set diffopt=internal,filler, linematch:30\<CR> " )
30483054 call WriteDiffFiles3 (buf ,
30493055 \ [" " ,
30503056 \ " common line" ,
@@ -3079,7 +3085,7 @@ func Test_linematch_3diffs_sanity_check()
30793085 call delete (' .Xfile_linematch2.swp' )
30803086 call delete (' .Xfile_linematch3.swp' )
30813087 let lines = << trim END
3082- set diffopt += linematch:60
3088+ set diffopt = internal,filler, linematch:60
30833089 call feedkeys (" Aq\<esc> " )
30843090 call feedkeys (" GAklm\<esc> " )
30853091 call feedkeys (" o" )
0 commit comments