forked from aniani/vim
patch 9.1.0740: incorrect internal diff with empty file
Problem: incorrect internal diff with an empty file
Solution: Set pointer to NULL, instead of using an empty line file
(Yukihiro Nakadaira)
When using internal diff, empty file is read as one empty line file.
So result differs from external diff.
closes: #15719
Signed-off-by: Yukihiro Nakadaira <yukihiro.nakadaira@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
a6de28755e
commit
f1694b439b
@@ -1015,9 +1015,17 @@ func Test_diff_screen()
|
||||
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
|
||||
" Test 20: test diffopt+=iwhiteall
|
||||
call VerifyInternal(buf, 'Test_diff_20', " diffopt+=iwhiteall")
|
||||
|
||||
" Test 21: Delete all lines
|
||||
call WriteDiffFiles(buf, [0], [])
|
||||
call VerifyBoth(buf, "Test_diff_21", "")
|
||||
|
||||
" Test 22: Add line to empty file
|
||||
call WriteDiffFiles(buf, [], [0])
|
||||
call VerifyBoth(buf, "Test_diff_22", "")
|
||||
|
||||
" clean up
|
||||
call StopVimInTerminal(buf)
|
||||
call delete('Xdifile1')
|
||||
|
||||
Reference in New Issue
Block a user