From c0ff0cac8719a175a2cdd8244d12015aef854b51 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Wed, 29 Dec 2021 16:57:40 +0000 Subject: vim-patch:8.2.3936: no proper test for maintaining change mark in diff mode Problem: No proper test for maintaining change mark in diff mode. Solution: Run the test with internal and external diff. (Sean Dewar, closes vim/vim#9424) https://github.com/vim/vim/commit/ccc1644f95e7833c23fa0d440e42293c1622fdcb --- src/nvim/testdir/test_diffmode.vim | 40 +++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/nvim/testdir/test_diffmode.vim b/src/nvim/testdir/test_diffmode.vim index fe928c0f65..9829b6b654 100644 --- a/src/nvim/testdir/test_diffmode.vim +++ b/src/nvim/testdir/test_diffmode.vim @@ -1147,22 +1147,30 @@ func Test_diff_followwrap() endfunc func Test_diff_maintains_change_mark() - enew! - call setline(1, ['a', 'b', 'c', 'd']) - diffthis - new - call setline(1, ['a', 'b', 'c', 'e']) - " Set '[ and '] marks - 2,3yank - call assert_equal([2, 3], [line("'["), line("']")]) - " Verify they aren't affected by the implicit diff - diffthis - call assert_equal([2, 3], [line("'["), line("']")]) - " Verify they aren't affected by an explicit diff - diffupdate - call assert_equal([2, 3], [line("'["), line("']")]) - bwipe! - bwipe! + func DiffMaintainsChangeMark() + enew! + call setline(1, ['a', 'b', 'c', 'd']) + diffthis + new + call setline(1, ['a', 'b', 'c', 'e']) + " Set '[ and '] marks + 2,3yank + call assert_equal([2, 3], [line("'["), line("']")]) + " Verify they aren't affected by the implicit diff + diffthis + call assert_equal([2, 3], [line("'["), line("']")]) + " Verify they aren't affected by an explicit diff + diffupdate + call assert_equal([2, 3], [line("'["), line("']")]) + bwipe! + bwipe! + endfunc + + set diffopt-=internal + call DiffMaintainsChangeMark() + set diffopt+=internal + call DiffMaintainsChangeMark() + set diffopt& endfunc func Test_diff_rnu() -- cgit