summaryrefslogtreecommitdiff
path: root/src/testdir/test_normal.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-10-13 20:23:28 +0100
committerBram Moolenaar <Bram@vim.org>2022-10-13 20:23:28 +0100
commit4b6172e108fe06be47c09f8690dc54608be3ee80 (patch)
tree0eeeebdeb0dbd734d595a9c6101d9857ca37e51a /src/testdir/test_normal.vim
parent6c4d4a64449ea225b1a568f5517e309b2054b490 (diff)
downloadvim-git-4b6172e108fe06be47c09f8690dc54608be3ee80.tar.gz
patch 9.0.0745: wrong cursor position when using "gj" and "gk" in a long linev9.0.0745
Problem: Wrong cursor position when using "gj" and "gk" in a long line. Solution: Adjust computations for the cursor position and skipcol. Re-enable tests that pass now, disable failing breakindent test.
Diffstat (limited to 'src/testdir/test_normal.vim')
-rw-r--r--src/testdir/test_normal.vim42
1 files changed, 35 insertions, 7 deletions
diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim
index 88ffd203f..909492718 100644
--- a/src/testdir/test_normal.vim
+++ b/src/testdir/test_normal.vim
@@ -3647,17 +3647,45 @@ endfunc
" Test for 'scrolloff' with a long line that doesn't fit in the screen
func Test_normal_scroloff()
10new
- 80vnew
- call setline(1, repeat('a', 1000))
+ 60vnew
+ call setline(1, ' 1 ' .. repeat('a', 57)
+ \ .. ' 2 ' .. repeat('b', 57)
+ \ .. ' 3 ' .. repeat('c', 57)
+ \ .. ' 4 ' .. repeat('d', 57)
+ \ .. ' 5 ' .. repeat('e', 57)
+ \ .. ' 6 ' .. repeat('f', 57)
+ \ .. ' 7 ' .. repeat('g', 57)
+ \ .. ' 8 ' .. repeat('h', 57)
+ \ .. ' 9 ' .. repeat('i', 57)
+ \ .. '10 ' .. repeat('j', 57)
+ \ .. '11 ' .. repeat('k', 57)
+ \ .. '12 ' .. repeat('l', 57)
+ \ .. '13 ' .. repeat('m', 57)
+ \ .. '14 ' .. repeat('n', 57)
+ \ .. '15 ' .. repeat('o', 57)
+ \ .. '16 ' .. repeat('p', 57)
+ \ .. '17 ' .. repeat('q', 57)
+ \ .. '18 ' .. repeat('r', 57)
+ \ .. '19 ' .. repeat('s', 57)
+ \ .. '20 ' .. repeat('t', 57)
+ \ .. '21 ' .. repeat('u', 57)
+ \ .. '22 ' .. repeat('v', 57)
+ \ .. '23 ' .. repeat('w', 57)
+ \ .. '24 ' .. repeat('x', 57)
+ \ .. '25 ' .. repeat('y', 57)
+ \ .. '26 ' .. repeat('z', 57)
+ \ )
set scrolloff=10
normal gg10gj
-" FIXME: currently get 10
-" call assert_equal(8, winline())
+ call assert_equal(6, winline())
normal 10gj
-" FIXME: currently get 9
-" call assert_equal(10, winline())
+ call assert_equal(6, winline())
normal 10gk
- call assert_equal(3, winline())
+ call assert_equal(6, winline())
+ normal 0
+ call assert_equal(1, winline())
+ normal $
+ call assert_equal(10, winline())
set scrolloff&
close!
endfunc