diff src/testdir/test_diffmode.vim @ 15103:9339601e7a31 v8.1.0562

patch 8.1.0562: parsing of 'diffopt' is slightly wrong commit https://github.com/vim/vim/commit/b6fc72851c45a36a370f9516c68508e47b41c4c1 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Dec 4 22:24:16 2018 +0100 patch 8.1.0562: parsing of 'diffopt' is slightly wrong Problem: Parsing of 'diffopt' is slightly wrong. Solution: Fix the parsing and add a test. (Jason Franklin, Christian Brabandt)
author Bram Moolenaar <Bram@vim.org>
date Tue, 04 Dec 2018 22:30:07 +0100
parents 28fde4aa8534
children 360c93a884d0
line wrap: on
line diff
--- a/src/testdir/test_diffmode.vim
+++ b/src/testdir/test_diffmode.vim
@@ -813,8 +813,16 @@ func Test_diff_screen()
   call term_sendkeys(buf, ":set diffopt+=internal\<cr>")
   call VerifyScreenDump(buf, 'Test_diff_10', {})
 
-  call term_sendkeys(buf, ":set diffopt+=indent-heuristic\<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')
+  " 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>")
+  call VerifyScreenDump(buf, 'Test_diff_11', {}, 'two')
+  call term_sendkeys(buf, ":set diffopt&\<cr>")
+  call term_sendkeys(buf, ":set diffopt+=algorithm:patience,indent-heuristic\<cr>:\<cr>")
+  call VerifyScreenDump(buf, 'Test_diff_11', {}, 'three')
 
   " 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])