diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-07-10 15:07:15 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-07-10 15:07:15 +0200 |
commit | 907dad72ef9d29422352fb74ba156e7085a3fc71 (patch) | |
tree | 87f564906e64ad84b4c09a941f3fd873784570a9 /src/testdir/test_fold.vim | |
parent | 6259e5769dd50d8a3b5b99f553bab34ff5c8a6ce (diff) | |
download | vim-git-907dad72ef9d29422352fb74ba156e7085a3fc71.tar.gz |
patch 8.1.0174: after paging up and down fold line is wrongv8.1.0174
Problem: After paging up and down fold line is wrong.
Solution: Correct the computation of w_topline and w_botline. (Hirohito
Higashi)
Diffstat (limited to 'src/testdir/test_fold.vim')
-rw-r--r-- | src/testdir/test_fold.vim | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/testdir/test_fold.vim b/src/testdir/test_fold.vim index de6688365..df4b12c8c 100644 --- a/src/testdir/test_fold.vim +++ b/src/testdir/test_fold.vim @@ -1,5 +1,7 @@ " Test for folding +source view_util.vim + func PrepIndent(arg) return [a:arg] + repeat(["\t".a:arg], 5) endfu @@ -648,3 +650,27 @@ func Test_foldopen_exception() endtry call assert_match('E492:', a) endfunc + +func Test_fold_last_line_with_pagedown() + enew! + set fdm=manual + + let expect = '+-- 11 lines: 9---' + let content = range(1,19) + call append(0, content) + normal dd9G + normal zfG + normal zt + call assert_equal('9', getline(foldclosed('.'))) + call assert_equal('19', getline(foldclosedend('.'))) + call assert_equal(expect, ScreenLines(1, len(expect))[0]) + call feedkeys("\<C-F>", 'xt') + call assert_equal(expect, ScreenLines(1, len(expect))[0]) + call feedkeys("\<C-F>", 'xt') + call assert_equal(expect, ScreenLines(1, len(expect))[0]) + call feedkeys("\<C-B>\<C-F>\<C-F>", 'xt') + call assert_equal(expect, ScreenLines(1, len(expect))[0]) + + set fdm& + enew! +endfunc |