From 808f5043055f9bd2f083befc0d50f00b0ffb5c25 Mon Sep 17 00:00:00 2001 From: ckelsel Date: Mon, 15 Jan 2018 20:08:37 +0800 Subject: vim-patch:8.0.0421: diff mode wrong when adding line at end of buffer Problem: Diff mode is displayed wrong when adding a line at the end of a buffer. Solution: Adjust marks in diff mode. (James McCoy, closes vim/vim#1329) https://github.com/vim/vim/commit/f58a8475e17bd566760fc7e2a17d35ddf4edacf2 --- src/nvim/testdir/test_diffmode.vim | 20 ++++++++++++++++++++ 1 file changed, 20 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 8ee82bd538..88f73cdb5b 100644 --- a/src/nvim/testdir/test_diffmode.vim +++ b/src/nvim/testdir/test_diffmode.vim @@ -272,3 +272,23 @@ func Test_setting_cursor() call delete('Xtest1') call delete('Xtest2') endfunc + +func Test_diff_lastline() + enew! + only! + call setline(1, ['This is a ', 'line with five ', 'rows']) + diffthis + botright vert new + call setline(1, ['This is', 'a line with ', 'four rows']) + diffthis + 1 + call feedkeys("Je a\", 'tx') + call feedkeys("Je a\", 'tx') + let w1lines = winline() + wincmd w + $ + let w2lines = winline() + call assert_equal(w2lines, w1lines) + bwipe! + bwipe! +endfunc -- cgit