patch 9.1.1753: defaults: 'diffopt' option value can be improved

Commit: 
https://github.com/vim/vim/commit/976b365305c2e9025813ff3c7fe52f8d927fafc3
Author: Yee Cheng Chin <[email protected]>
Date:   Thu Sep 11 15:02:21 2025 -0400

    patch 9.1.1753: defaults: 'diffopt' option value can be improved
    
    Problem:  defaults: 'diffopt' option value can be improved
    Solution: Update diffopt defaults to include "indent-heuristic" and
              "inline:char" (Yee Cheng Chin)
    
    The default diff options have not been updated much despite new
    functionality having been added to Vim.
    
    - indent-heurstic: This has been enabled by default in Git since
      33de716387 in 2017. Given that Vim uses xdiff from Git, it makes sense
      to track the default configuration from Git.
    
    - inline:char: This turns on character-wise inline highlighting which is
      generally much better than the default inline:simple. It has been
      implemented since #16881 and we have not seen reports of any issues
      with it, and it has received good feedbacks.
    
    closes: #18255
    
    Signed-off-by: Yee Cheng Chin <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index f318a8b59..6d6f341bc 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt*  For Vim version 9.1.  Last change: 2025 Sep 10
+*options.txt*  For Vim version 9.1.  Last change: 2025 Sep 11
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -3067,7 +3067,7 @@ A jump table for the options with a short description can 
be found at |Q_op|.
 
                                                *'dip'* *'diffopt'*
 'diffopt' 'dip'                string  (default
-                                "internal,filler,closeoff,inline:simple")
+                                
"internal,filler,closeoff,indent-heuristic,inline:char")
                        global
                        {not available when compiled without the |+diff|
                        feature}
diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt
index c7f725bad..72f9a42ba 100644
--- a/runtime/doc/version9.txt
+++ b/runtime/doc/version9.txt
@@ -1,4 +1,4 @@
-*version9.txt*  For Vim version 9.1.  Last change: 2025 Sep 10
+*version9.txt*  For Vim version 9.1.  Last change: 2025 Sep 11
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -41670,6 +41670,8 @@ Default values: ~
 - the default value for 'showcmd' is always enabled when using non-compatible
   mode (previously, it was off on UNIX systems) and consequently removed from
   |defaults.vim|
+- Improve the diff experience by updating the 'diffopt' default value to
+  "internal,filler,closeoff,indent-heuristic,inline:char".
 
 Completion: ~
 - allow to complete directories from 'cdpath' for |:cd| and similar commands,
diff --git a/src/diff.c b/src/diff.c
index 13afade25..1a60ee7ae 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -46,9 +46,9 @@ static int diff_need_update = FALSE; // ex_diffupdate needs 
to be called
 #define ALL_WHITE_DIFF (DIFF_IWHITE | DIFF_IWHITEALL | DIFF_IWHITEEOL)
 #define ALL_INLINE (DIFF_INLINE_NONE | DIFF_INLINE_SIMPLE | DIFF_INLINE_CHAR | 
DIFF_INLINE_WORD)
 #define ALL_INLINE_DIFF (DIFF_INLINE_CHAR | DIFF_INLINE_WORD)
-static int     diff_flags = DIFF_INTERNAL | DIFF_FILLER | DIFF_CLOSE_OFF;
+static int     diff_flags = DIFF_INTERNAL | DIFF_FILLER | DIFF_CLOSE_OFF | 
DIFF_INLINE_CHAR;
 
-static long diff_algorithm = 0;
+static long diff_algorithm = XDF_INDENT_HEURISTIC;
 
 #define LBUFLEN 50             // length of line in diff file
 
diff --git a/src/optiondefs.h b/src/optiondefs.h
index ea49e80b2..ed3c35ccb 100644
--- a/src/optiondefs.h
+++ b/src/optiondefs.h
@@ -896,7 +896,7 @@ static struct vimoption options[] =
                                                                     |P_NODUP,
 #ifdef FEAT_DIFF
                            (char_u *)&p_dip, PV_NONE, did_set_diffopt, 
expand_set_diffopt,
-                           {(char_u *)"internal,filler,closeoff,inline:simple",
+                           {(char_u 
*)"internal,filler,closeoff,indent-heuristic,inline:char",
                                                                (char_u *)NULL}
 #else
                            (char_u *)NULL, PV_NONE, NULL, NULL,
diff --git a/src/testdir/dumps/Test_diff_10.dump 
b/src/testdir/dumps/Test_diff_10.dump
index 8bc91fb8b..6942f9354 100644
--- a/src/testdir/dumps/Test_diff_10.dump
+++ b/src/testdir/dumps/Test_diff_10.dump
@@ -17,4 +17,4 @@
 |~| @35||+1#0000000&|~+0#4040ff13&| @35
 |~| @35||+1#0000000&|~+0#4040ff13&| @35
 |X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|0|-|1| @9|A|l@1| |X+1&&|d|i|f|i|l|e|2| 
@10|1|,|0|-|1| @9|A|l@1
-|:+0&&|s|e|t| |d|i|f@1|o|p|t|+|=|i|n|t|e|r|n|a|l| @52
+|:+0&&| @73
diff --git a/src/testdir/dumps/Test_diff_with_cursorline_01.dump 
b/src/testdir/dumps/Test_diff_with_cursorline_01.dump
index d43c9caa5..31d8b2a18 100644
--- a/src/testdir/dumps/Test_diff_with_cursorline_01.dump
+++ b/src/testdir/dumps/Test_diff_with_cursorline_01.dump
@@ -1,8 +1,8 @@
 | +0#0000e05#a8a8a8255@1|b+8#ffffff16#ff404010|e@1| @31||+1#0000000#ffffff0| 
+0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34
 | +0#0000e05#a8a8a8255@1|f+0#0000000#ffffff0|o@1| @31||+1&&| 
+0#0000e05#a8a8a8255@1>f+8#ffffff16#ff404010|o@1| @31
 | +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|b+2#0000000#ff404010|a|z| 
+0&#ffd7ff255@31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|f+2#0000000#ff404010|o@1| 
+0&#ffd7ff255@31
-| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| 
+0#0000e05#a8a8a8255@1|b+0#0000000#5fd7ff255|a|r| @31
+| +0#0000e05#a8a8a8255@1|b+0#0000000#ffd7ff255|a|z+2&#ff404010| 
+0&#ffd7ff255@31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|f+2#0000000#ff404010|o@1| 
+0&#ffd7ff255@31
+| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| 
+0#0000e05#a8a8a8255@1|b+0#0000000#ffd7ff255|a|r+2&#ff404010| +0&#ffd7ff255@31
 |~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35
 |~| @35||+1#0000000&|~+0#4040ff13&| @35
 |~| @35||+1#0000000&|~+0#4040ff13&| @35
diff --git a/src/testdir/dumps/Test_diff_with_cursorline_02.dump 
b/src/testdir/dumps/Test_diff_with_cursorline_02.dump
index 477e3678a..9aef7d1fa 100644
--- a/src/testdir/dumps/Test_diff_with_cursorline_02.dump
+++ b/src/testdir/dumps/Test_diff_with_cursorline_02.dump
@@ -1,8 +1,8 @@
 | +0#0000e05#a8a8a8255@1|b+0#0000000#5fd7ff255|e@1| @31||+1&#ffffff0| 
+0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34
 | +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|f+8#ffffff16#ff404010|o@1| @31||+1#0000000#ffffff0| 
+0#0000e05#a8a8a8255@1>f+8#ffffff16#ff404010|o@1| @31
-| +0#0000e05#a8a8a8255@1|b+2#0000000#ff404010|a|z| 
+0&#ffd7ff255@31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|f+2#0000000#ff404010|o@1| 
+0&#ffd7ff255@31
-| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| 
+0#0000e05#a8a8a8255@1|b+0#0000000#5fd7ff255|a|r| @31
+| +0#0000e05#a8a8a8255@1|b+0#0000000#ffd7ff255|a|z+2&#ff404010| 
+0&#ffd7ff255@31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|f+2#0000000#ff404010|o@1| 
+0&#ffd7ff255@31
+| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| 
+0#0000e05#a8a8a8255@1|b+0#0000000#ffd7ff255|a|r+2&#ff404010| +0&#ffd7ff255@31
 |~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35
 |~| @35||+1#0000000&|~+0#4040ff13&| @35
 |~| @35||+1#0000000&|~+0#4040ff13&| @35
diff --git a/src/testdir/dumps/Test_diff_with_cursorline_03.dump 
b/src/testdir/dumps/Test_diff_with_cursorline_03.dump
index efef1c15b..5bc9e1316 100644
--- a/src/testdir/dumps/Test_diff_with_cursorline_03.dump
+++ b/src/testdir/dumps/Test_diff_with_cursorline_03.dump
@@ -1,8 +1,8 @@
 | +0#0000e05#a8a8a8255@1|b+0#0000000#5fd7ff255|e@1| @31||+1&#ffffff0| 
+0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34
 | +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|f+0#0000000#ffffff0|o@1| @31||+1&&| 
+0#0000e05#a8a8a8255@1|f+0#0000000#ffffff0|o@1| @31
-| +0#0000e05#a8a8a8255@1|b+10#ffffff16#ff404010|a|z| 
+8&&@31||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1>f+10#ffffff16#ff404010|o@1| 
+8&&@31
-| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| 
+0#0000e05#a8a8a8255@1|b+0#0000000#5fd7ff255|a|r| @31
+| +0#0000e05#a8a8a8255@1|b+8#ffffff16#ff404010|a|z+10&&| 
+8&&@31||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1>f+10#ffffff16#ff404010|o@1| 
+8&&@31
+| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| 
+0#0000e05#a8a8a8255@1|b+0#0000000#ffd7ff255|a|r+2&#ff404010| +0&#ffd7ff255@31
 |~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35
 |~| @35||+1#0000000&|~+0#4040ff13&| @35
 |~| @35||+1#0000000&|~+0#4040ff13&| @35
diff --git a/src/testdir/dumps/Test_smooth_diff_change_line_3a.dump 
b/src/testdir/dumps/Test_smooth_diff_change_line_3a.dump
new file mode 100644
index 000000000..d13141eb2
--- /dev/null
+++ b/src/testdir/dumps/Test_smooth_diff_change_line_3a.dump
@@ -0,0 +1,20 @@
+|<+0#4040ff13#ffffff0@2| +0#0000000&|a|b|c| |a|b|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| |a|b|c| |a|b|c| |a||+1&&|<+0#4040ff13&@2| +0#0000000&|a|b|c| |a|b|c| 
|a|b|c| |a|b|c| |a|b|c| |a|b|c| |a|b|c| |a|b|c| |a
+| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| |a|b|c| |a|b|c| |a|b|c| |a|b|c| ||+1&&| 
+0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0|c| |a|b|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| |a|b|c| |a|b|c| |a|b|c| 
+| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|b|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| |a|b|c| |a|b|c| |a|b|c| |a|b|c||+1&&| 
+0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|b|c| |a|b|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| |a|b|c| |a|b|c| |a|b|c
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0|a|b|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| @14||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0|a|b|c| |a|b|c| 
|a|b|c| |a|b|c| |a|b|c| @14
+| +0#0000e05#a8a8a8255@1|f+2#0000000#ff404010|o@1| 
+0&#ffd7ff255@31||+1&#ffffff0| 
+0#0000e05#a8a8a8255@1|b+2#0000000#ff404010|a|r|b+0&#ffd7ff255|a>r| @28
+| +0#0000e05#a8a8a8255@1|b+0#0000000#ffd7ff255|a|r| @31||+1&#ffffff0| 
+0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0|a|b|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| |a|b|c| |a|b|c| |a|b|c| |a|b||+1&&| +0#0000e05#a8a8a8255@1| 
+0#0000000#ffffff0|a|b|c| |a|b|c| |a|b|c| |a|b|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| |a|b
+| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0| |a|b|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| |a|b|c| |a|b|c| |a|b|c| |a||+1&&| 
+0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0| |a|b|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| |a|b|c| |a|b|c| |a|b|c| |a
+| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| |a|b|c| |a|b|c| |a|b|c| |a|b|c| ||+1&&| 
+0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0|c| |a|b|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| |a|b|c| |a|b|c| |a|b|c| 
+| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|b|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| |a|b|c| |a|b|c| |a|b|c| |a|b|c||+1&&| 
+0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|b|c| |a|b|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| |a|b|c| |a|b|c| |a|b|c
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0|a|b|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| |a|b|c| |a|b|c| |a|b|c| |a|b||+1&&| +0#0000e05#a8a8a8255@1| 
+0#0000000#ffffff0|a|b|c| |a|b|c| |a|b|c| |a|b|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| |a|b
+| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0| |a|b|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| |a|b|c| |a|b|c| |a|b|c| |a||+1&&| 
+0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0| |a|b|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| |a|b|c| |a|b|c| |a|b|c| |a
+| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| |a|b|c| |a|b|c| |a|b|c| |a|b|c| ||+1&&| 
+0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0|c| |a|b|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| |a|b|c| |a|b|c| |a|b|c| 
+| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|b|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| |a|b|c| |a|b|c| |a|b|c| |a|b|c||+1&&| 
+0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|b|c| |a|b|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| |a|b|c| |a|b|c| |a|b|c
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0|a|b|c| |a|b|c| |a|b|c| |a|b|c| 
|a|b|c| @14||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0|a|b|c| |a|b|c| 
|a|b|c| |a|b|c| |a|b|c| @14
+|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|[+1#0000000&|N|o| |N|a|m|e|]| |[|+|]| @5|2|,|4| @11|A|l@1| |[+3&&|N|o| 
|N|a|m|e|]| |[|+|]| @5|2|,|6| @11|A|l@1
+| +0&&@74
diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim
index 5ea7a7c8a..42f9463b3 100644
--- a/src/testdir/test_diffmode.vim
+++ b/src/testdir/test_diffmode.vim
@@ -862,6 +862,7 @@ func Test_diff_nomodifiable()
 endfunc
 
 func Test_diff_hlID()
+  set diffopt=internal,filler
   new
   call setline(1, [1, 2, 3, 'Yz', 'a dxxg',])
   diffthis
@@ -904,6 +905,7 @@ func Test_diff_hlID()
   call assert_equal(synIDattr(diff_hlID(3, 1), "name"), "")
 
   %bwipe!
+  set diffopt&
 endfunc
 
 func Test_diff_filler()
@@ -1079,18 +1081,18 @@ func Test_diff_screen()
   call term_sendkeys(buf, ":set diffopt+=algorithm:histogram\<cr>")
   call VerifyScreenDump(buf, 'Test_diff_09', {})
 
-  " Test 10-11: normal/indent-heuristic
+  " Test 10-11: with/without 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>")
-  call term_sendkeys(buf, ":set diffopt+=internal\<cr>")
-  call VerifyScreenDump(buf, 'Test_diff_10', {})
+  call term_sendkeys(buf, ":set diffopt+=internal\<cr>:\<cr>")
+  call VerifyScreenDump(buf, 'Test_diff_11', {})
 
   " Leave trailing : at commandline!
-  call term_sendkeys(buf, ":set diffopt+=indent-heuristic\<cr>:\<cr>")
-  call VerifyScreenDump(buf, 'Test_diff_11', {}, 'one')
+  call term_sendkeys(buf, ":set diffopt-=indent-heuristic\<cr>:\<cr>")
+  call VerifyScreenDump(buf, 'Test_diff_10', {}, 'one')
   " shouldn't matter, if indent-algorithm comes before or after the algorithm
   call term_sendkeys(buf, ":set diffopt&\<cr>")
   call term_sendkeys(buf, ":set 
diffopt+=indent-heuristic,algorithm:patience\<cr>:\<cr>")
@@ -1331,6 +1333,7 @@ func Test_diff_with_syntax()
   call writefile(lines, 'Xprogram2.c', 'D')
 
   let lines =<< trim END
+    set diffopt=internal,filler
        edit Xprogram1.c
        diffsplit Xprogram2.c
   END
@@ -1473,6 +1476,7 @@ func Test_diff_rnu()
   CheckScreendump
 
   let content =<< trim END
+    set diffopt=internal,filler
     call setline(1, ['a', 'a', 'a', 'y', 'b', 'b', 'b', 'b', 'b'])
     vnew
     call setline(1, ['a', 'a', 'a', 'x', 'x', 'x', 'b', 'b', 'b', 'b', 'b'])
@@ -1560,6 +1564,7 @@ endfunc
 " Test for adding/removing lines inside diff chunks, between diff chunks
 " and before diff chunks
 func Test_diff_modify_chunks()
+  set diffopt=internal,filler
   enew!
   let w2_id = win_getid()
   call setline(1, ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'])
@@ -1639,6 +1644,7 @@ func Test_diff_modify_chunks()
   call assert_equal(['', '', '', '', '', '', '', '', ''], hl)
 
   %bw!
+  set diffopt&
 endfunc
 
 func Test_diff_binary()
@@ -2868,7 +2874,7 @@ func Test_linematch_diff()
   call term_sendkeys(buf, ":set autoread\<CR>\<c-w>w:set autoread\<CR>\<c-w>w")
 
   " enable linematch
-  call term_sendkeys(buf, ":set diffopt+=linematch:30\<CR>")
+  call term_sendkeys(buf, ":set diffopt=internal,filler,linematch:30\<CR>")
   call WriteDiffFiles(buf, ['// abc d?',
       \ '// d?',
       \ '// d?' ],
@@ -2896,7 +2902,7 @@ func Test_linematch_diff_iwhite()
   call term_sendkeys(buf, ":set autoread\<CR>\<c-w>w:set autoread\<CR>\<c-w>w")
 
   " setup a diff with 2 files and set linematch:30, with ignore white
-  call term_sendkeys(buf, ":set diffopt+=linematch:30\<CR>")
+  call term_sendkeys(buf, ":set diffopt=internal,filler,linematch:30\<CR>")
   call WriteDiffFiles(buf, ['void testFunction () {',
       \ '  for (int i = 0; i < 10; i++) {',
       \ '    for (int j = 0; j < 10; j++) {',
@@ -2923,7 +2929,7 @@ func Test_linematch_diff_grouping()
   call term_sendkeys(buf, ":set autoread\<CR>\<c-w>w:set autoread\<CR>\<c-w>w")
 
   " a diff that would result in multiple groups before grouping optimization
-  call term_sendkeys(buf, ":set diffopt+=linematch:30\<CR>")
+  call term_sendkeys(buf, ":set diffopt=internal,filler,linematch:30\<CR>")
   call WriteDiffFiles(buf, ['!A',
       \ '!B',
       \ '!C' ],
@@ -2961,7 +2967,7 @@ func Test_linematch_diff_scroll()
   call term_sendkeys(buf, ":set autoread\<CR>\<c-w>w:set autoread\<CR>\<c-w>w")
 
   " a diff that would result in multiple groups before grouping optimization
-  call term_sendkeys(buf, ":set diffopt+=linematch:30\<CR>")
+  call term_sendkeys(buf, ":set diffopt=internal,filler,linematch:30\<CR>")
   call WriteDiffFiles(buf, ['!A',
       \ '!B',
       \ '!C' ],
@@ -2992,7 +2998,7 @@ func Test_linematch_line_limit_exceeded()
   let buf = RunVimInTerminal('-d Xdifile1 Xdifile2', {})
   call term_sendkeys(buf, ":set autoread\<CR>\<c-w>w:set autoread\<CR>\<c-w>w")
 
-  call term_sendkeys(buf, ":set diffopt+=linematch:10\<CR>")
+  call term_sendkeys(buf, ":set diffopt=internal,filler,linematch:10\<CR>")
   " a diff block will not be aligned with linematch because it's contents
   " exceed 10 lines
   call WriteDiffFiles(buf,
@@ -3044,7 +3050,7 @@ func Test_linematch_3diffs()
   call term_sendkeys(buf, "1\<c-w>w:set autoread\<CR>")
   call term_sendkeys(buf, "2\<c-w>w:set autoread\<CR>")
   call term_sendkeys(buf, "3\<c-w>w:set autoread\<CR>")
-  call term_sendkeys(buf, ":set diffopt+=linematch:30\<CR>")
+  call term_sendkeys(buf, ":set diffopt=internal,filler,linematch:30\<CR>")
   call WriteDiffFiles3(buf,
         \ ["",
         \ "  common line",
@@ -3079,7 +3085,7 @@ func Test_linematch_3diffs_sanity_check()
   call delete('.Xfile_linematch2.swp')
   call delete('.Xfile_linematch3.swp')
   let lines =<< trim END
-    set diffopt+=linematch:60
+    set diffopt=internal,filler,linematch:60
     call feedkeys("Aq\<esc>")
     call feedkeys("GAklm\<esc>")
     call feedkeys("o")
diff --git a/src/testdir/test_scroll_opt.vim b/src/testdir/test_scroll_opt.vim
index 4e2997617..81415e1c6 100644
--- a/src/testdir/test_scroll_opt.vim
+++ b/src/testdir/test_scroll_opt.vim
@@ -301,11 +301,43 @@ func Test_smoothscroll_diff_mode()
   call StopVimInTerminal(buf)
 endfunc
 
+func Test_smoothscroll_diff_change_line_default()
+  CheckScreendump
+
+  " Uses the new diffopt default with indent-heuristic and inline:char
+  let lines =<< trim END
+    set 
diffopt=internal,filler,closeoff,indent-heuristic,inline:char,followwrap 
smoothscroll
+    call setline(1, repeat(' abc', &columns))
+    call setline(2, 'bar')
+    call setline(3, repeat(' abc', &columns))
+    vnew
+    call setline(1, repeat(' abc', &columns))
+    call setline(2, 'foo')
+    call setline(3, 'bar')
+    call setline(4, repeat(' abc', &columns))
+    windo exe "normal! 2gg5\<C-E>"
+    windo diffthis
+  END
+  call writefile(lines, 'XSmoothDiffChangeLine', 'D')
+  let buf = RunVimInTerminal('-S XSmoothDiffChangeLine', #{rows: 20, columns: 
55})
+
+  call VerifyScreenDump(buf, 'Test_smooth_diff_change_line_1', {})
+  call term_sendkeys(buf, "Abar")
+  call VerifyScreenDump(buf, 'Test_smooth_diff_change_line_2', {})
+  call term_sendkeys(buf, "\<Esc>")
+  call VerifyScreenDump(buf, 'Test_smooth_diff_change_line_3a', {})
+  call term_sendkeys(buf, "yyp")
+  call VerifyScreenDump(buf, 'Test_smooth_diff_change_line_4', {})
+
+  call StopVimInTerminal(buf)
+endfunc
+
 func Test_smoothscroll_diff_change_line()
   CheckScreendump
 
+  " Uses the old diffopt default
   let lines =<< trim END
-    set diffopt+=followwrap smoothscroll
+    set diffopt=internal,filler,closeoff,followwrap,inline:simple smoothscroll
     call setline(1, repeat(' abc', &columns))
     call setline(2, 'bar')
     call setline(3, repeat(' abc', &columns))
diff --git a/src/version.c b/src/version.c
index 7c186513b..3dbb664c3 100644
--- a/src/version.c
+++ b/src/version.c
@@ -724,6 +724,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1753,
 /**/
     1752,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1uwml6-000Xbm-P0%40256bit.org.

Raspunde prin e-mail lui