From 6d932ccb1c03208c4f5cc94f65517184e3c6d12f Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 24 May 2021 12:19:25 -0400 Subject: vim-patch:8.2.2880: unified diff fails if actually used Problem: Unified diff fails if actually used. Solution: Invoke :diffupdate in the test. Fix the check for working external diff. (Ghjuvan Lacambre, Christian Brabandt, closes vim/vim#8197) https://github.com/vim/vim/commit/ad5c178a191cf2cf37a27c2a789d7afda3879831 --- src/nvim/testdir/test_diffmode.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/nvim/testdir/test_diffmode.vim') diff --git a/src/nvim/testdir/test_diffmode.vim b/src/nvim/testdir/test_diffmode.vim index 1ade11a8ed..1f7d0e2ea3 100644 --- a/src/nvim/testdir/test_diffmode.vim +++ b/src/nvim/testdir/test_diffmode.vim @@ -802,6 +802,7 @@ func VerifyBoth(buf, dumpfile, extra) " also test unified diff call term_sendkeys(a:buf, ":call SetupUnified()\:") + call term_sendkeys(a:buf, ":redraw!\:") call VerifyScreenDump(a:buf, a:dumpfile, {}, 'unified') call term_sendkeys(a:buf, ":call StopUnified()\:") endfunc @@ -823,10 +824,11 @@ func Test_diff_screen() func UnifiedDiffExpr() " Prepend some text to check diff type detection call writefile(['warning', ' message'], v:fname_out) - silent exe '!diff -u ' .. v:fname_in .. ' ' .. v:fname_new .. '>>' .. v:fname_out + silent exe '!diff -U0 ' .. v:fname_in .. ' ' .. v:fname_new .. '>>' .. v:fname_out endfunc func SetupUnified() set diffexpr=UnifiedDiffExpr() + diffupdate endfunc func StopUnified() set diffexpr= @@ -1146,4 +1148,5 @@ func Test_diff_and_scroll() set ls& endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit From db3136d2eac607514ca76a6e4defc33dedd1539d Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 24 May 2021 12:45:38 -0400 Subject: vim-patch:8.2.1957: diff and cursorcolumn highlighting don't mix Problem: Diff and cursorcolumn highlighting don't mix. Solution: Fix condition for what attribute to use. (Christian Brabandt, closes vim/vim#7258, closes vim/vim#7260) https://github.com/vim/vim/commit/fabc3ca896751277f18a3a68e5661179728db3ad --- src/nvim/testdir/test_diffmode.vim | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/nvim/testdir/test_diffmode.vim') diff --git a/src/nvim/testdir/test_diffmode.vim b/src/nvim/testdir/test_diffmode.vim index 1f7d0e2ea3..8592f48af7 100644 --- a/src/nvim/testdir/test_diffmode.vim +++ b/src/nvim/testdir/test_diffmode.vim @@ -1148,5 +1148,38 @@ func Test_diff_and_scroll() set ls& endfunc +func Test_diff_filler_cursorcolumn() + CheckScreendump + + let content =<< trim END + call setline(1, ['aa', 'bb', 'cc']) + vnew + call setline(1, ['aa', 'cc']) + windo diffthis + wincmd p + setlocal cursorcolumn foldcolumn=0 + norm! gg0 + redraw! + END + call writefile(content, 'Xtest_diff_cuc') + let buf = RunVimInTerminal('-S Xtest_diff_cuc', {}) + + call VerifyScreenDump(buf, 'Test_diff_cuc_01', {}) + + call term_sendkeys(buf, "l") + call term_sendkeys(buf, "\") + call VerifyScreenDump(buf, 'Test_diff_cuc_02', {}) + call term_sendkeys(buf, "0j") + call term_sendkeys(buf, "\") + call VerifyScreenDump(buf, 'Test_diff_cuc_03', {}) + call term_sendkeys(buf, "l") + call term_sendkeys(buf, "\") + call VerifyScreenDump(buf, 'Test_diff_cuc_04', {}) + + " clean up + call StopVimInTerminal(buf) + call delete('Xtest_diff_cuc') +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit