From 0785f8e8b11b2fa290cfbc0604d570f49b954ba6 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 17 Oct 2019 04:24:23 -0400 Subject: vim-patch:8.1.2140: "gk" and "gj" do not work correctly in number column #11208 Problem: "gk" and "gj" do not work correctly in number column. Solution: Allow for a negative "curswant". (Zach Wegner, closes vim/vim#4969) https://github.com/vim/vim/commit/ceba3dd5187788e09f65bd41b07b40f6f9aab953 --- src/nvim/testdir/test_normal.vim | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_normal.vim b/src/nvim/testdir/test_normal.vim index b967f84626..aeae6423d0 100644 --- a/src/nvim/testdir/test_normal.vim +++ b/src/nvim/testdir/test_normal.vim @@ -2813,4 +2813,29 @@ func Test_normal_gk() call assert_equal(95, virtcol('.')) bw! bw! + + " needs 80 column new window + new + vert 80new + set number + set numberwidth=10 + set cpoptions+=n + put =[repeat('0',90), repeat('1',90)] + norm! 075l + call assert_equal(76, col('.')) + norm! gk + call assert_equal(1, col('.')) + norm! gk + call assert_equal(76, col('.')) + norm! gk + call assert_equal(1, col('.')) + norm! gj + call assert_equal(76, col('.')) + norm! gj + call assert_equal(1, col('.')) + norm! gj + call assert_equal(76, col('.')) + bw! + bw! + set cpoptions& number& numberwidth& endfunc -- cgit