0
0
mirror of https://github.com/vim/vim.git synced 2025-10-04 05:25:06 -04:00

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)
This commit is contained in:
Bram Moolenaar
2018-12-04 22:24:16 +01:00
parent 9719568533
commit b6fc72851c
6 changed files with 21 additions and 7 deletions

View File

@@ -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])