comparison src/testdir/test_fold.vim @ 23687:09ad3f1b9714 v8.2.2385

patch 8.2.2385: "gj" and "gk" do not work correctly when inside a fold Commit: https://github.com/vim/vim/commit/e71996bd0865659bde5450f466bc3e53e83431b2 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 21 17:03:07 2021 +0100 patch 8.2.2385: "gj" and "gk" do not work correctly when inside a fold Problem: "gj" and "gk" do not work correctly when inside a fold. Solution: Move check for folding. (closes https://github.com/vim/vim/issues/7724, closes https://github.com/vim/vim/issues/4095)
author Bram Moolenaar <Bram@vim.org>
date Thu, 21 Jan 2021 17:15:04 +0100
parents ef4f890f02f6
children b6d8d9578375
comparison
equal deleted inserted replaced
23686:bc2b820a579b 23687:09ad3f1b9714
857 new 857 new
858 norm zFzFzdzj 858 norm zFzFzdzj
859 bwipe! 859 bwipe!
860 endfunc 860 endfunc
861 861
862 func Test_fold_relative_move()
863 enew!
864 set fdm=indent sw=2 wrap tw=80
865
866 let content = [ ' foo', ' bar', ' baz',
867 \ repeat('x', 100),
868 \ ' foo', ' bar', ' baz'
869 \ ]
870 call append(0, content)
871
872 normal zM
873
874 call cursor(3, 1)
875 call assert_true(foldclosed(line('.')))
876 normal gj
877 call assert_equal(2, winline())
878
879 call cursor(2, 1)
880 call assert_true(foldclosed(line('.')))
881 normal 2gj
882 call assert_equal(3, winline())
883
884 call cursor(5, 1)
885 call assert_true(foldclosed(line('.')))
886 normal gk
887 call assert_equal(3, winline())
888
889 call cursor(6, 1)
890 call assert_true(foldclosed(line('.')))
891 normal 2gk
892 call assert_equal(2, winline())
893
894 set fdm& sw& wrap& tw&
895 endfunc
896
862 " vim: shiftwidth=2 sts=2 expandtab 897 " vim: shiftwidth=2 sts=2 expandtab