Mercurial > vim
diff src/testdir/test_fold.vim @ 14317:1bc96dbb5498 v8.1.0174
patch 8.1.0174: after paging up and down fold line is wrong
commit https://github.com/vim/vim/commit/907dad72ef9d29422352fb74ba156e7085a3fc71
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jul 10 15:07:15 2018 +0200
patch 8.1.0174: after paging up and down fold line is wrong
Problem: After paging up and down fold line is wrong.
Solution: Correct the computation of w_topline and w_botline. (Hirohito
Higashi)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 10 Jul 2018 15:15:07 +0200 |
parents | cb9b2774f21f |
children | 081f30c50300 |
line wrap: on
line diff
--- 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