diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2023-05-09 16:01:17 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-05-09 16:01:17 +0100 |
commit | aa6ba308a1498dc8da04d1d30ec0470018bf782a (patch) | |
tree | e5fac86e1a7ae2af8bc6fa515a224ff76d304cdb /src/testdir | |
parent | c9471b18728b1b37c04845ca2bc59fc981308b2d (diff) | |
download | vim-git-aa6ba308a1498dc8da04d1d30ec0470018bf782a.tar.gz |
patch 9.0.1530: cursor moves to wrong line when 'foldmethod' is "diff"v9.0.1530
Problem: Cursor moves to wrong line when 'foldmethod' is "diff". (Rick
Howe)
Solution: Adjust logic for scrolling. (Luuk van Baal, closes #12364,
closes #12218)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/dumps/Test_normal_j_below_botline.dump | 19 | ||||
-rw-r--r-- | src/testdir/test_normal.vim | 18 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/testdir/dumps/Test_normal_j_below_botline.dump b/src/testdir/dumps/Test_normal_j_below_botline.dump new file mode 100644 index 000000000..e736b64d9 --- /dev/null +++ b/src/testdir/dumps/Test_normal_j_below_botline.dump @@ -0,0 +1,19 @@ +| +0#af5f00255#ffffff0@1|2| |2+0#0000000&@35 +| +0#af5f00255&@3|2+0#0000000&@35 +| +0#af5f00255&@3|2+0#0000000&@35 +| +0#af5f00255&@3|2+0#0000000&@35 +| +0#af5f00255&@3|2+0#0000000&@35 +| +0#af5f00255&@3|2+0#0000000&@19| @15 +| +0#af5f00255&@1|3| |3+0#0000000&@35 +| +0#af5f00255&@3|3+0#0000000&@35 +| +0#af5f00255&@3|3+0#0000000&@35 +| +0#af5f00255&@3|3+0#0000000&@35 +| +0#af5f00255&@3|3+0#0000000&@35 +| +0#af5f00255&@3|3+0#0000000&@19| @15 +| +0#af5f00255&@1|4| >4+0#0000000&@35 +| +0#af5f00255&@3|4+0#0000000&@35 +| +0#af5f00255&@3|4+0#0000000&@35 +| +0#af5f00255&@3|4+0#0000000&@35 +| +0#af5f00255&@3|4+0#0000000&@35 +| +0#af5f00255&@3|4+0#0000000&@19| @15 +@22|4|,|1| @10|1|6|%| diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim index 470b41cb0..a3d9454d2 100644 --- a/src/testdir/test_normal.vim +++ b/src/testdir/test_normal.vim @@ -3980,4 +3980,22 @@ func Test_mouse_shape_after_cancelling_gr() call delete('Xmouseshapes') endfunc +" Test that "j" does not skip lines when scrolling below botline and +" 'foldmethod' is not "manual". +func Test_normal_j_below_botline() + CheckScreendump + + let lines =<< trim END + set number foldmethod=diff scrolloff=0 + call setline(1, map(range(1, 9), 'repeat(v:val, 200)')) + norm Lj + END + call writefile(lines, 'XNormalJBelowBotline', 'D') + let buf = RunVimInTerminal('-S XNormalJBelowBotline', #{rows: 19, cols: 40}) + + call VerifyScreenDump(buf, 'Test_normal_j_below_botline', {}) + + call StopVimInTerminal(buf) +endfunc + " vim: shiftwidth=2 sts=2 expandtab |