@@ -1358,11 +1358,21 @@ func Test_normal23_K()
13581358 bw !
13591359 return
13601360 endif
1361- set keywordprg = man\ - -pager =cat
1361+
1362+ if has (' mac' )
1363+ " In MacOS, the option for specifying a pager is different
1364+ set keywordprg = man\ - P \ cat
1365+ else
1366+ set keywordprg = man\ - -pager =cat
1367+ endif
13621368 " Test for using man
13631369 2
13641370 let a = execute (' unsilent norm! K' )
1365- call assert_match (" man --pager=cat 'man'" , a )
1371+ if has (' mac' )
1372+ call assert_match (" man -P cat 'man'" , a )
1373+ else
1374+ call assert_match (" man --pager=cat 'man'" , a )
1375+ endif
13661376
13671377 " clean up
13681378 let &keywordprg = k
@@ -2559,3 +2569,81 @@ func Test_message_when_using_ctrl_c()
25592569
25602570 bwipe!
25612571endfunc
2572+
2573+ " Test for '[m', ']m', '[M' and ']M'
2574+ " Jumping to beginning and end of methods in Java-like languages
2575+ func Test_java_motion ()
2576+ new
2577+ a
2578+ Piece of Java
2579+ {
2580+ tt m1 {
2581+ t1;
2582+ } e1
2583+
2584+ tt m2 {
2585+ t2;
2586+ } e2
2587+
2588+ tt m3 {
2589+ if (x )
2590+ {
2591+ t3;
2592+ }
2593+ } e3
2594+ }
2595+ .
2596+
2597+ normal gg
2598+
2599+ normal 2 ]maA
2600+ call assert_equal (" \t tt m1 {A" , getline (' .' ))
2601+ call assert_equal ([3 , 9 , 16 ], [line (' .' ), col (' .' ), virtcol (' .' )])
2602+
2603+ normal j ]maB
2604+ call assert_equal (" \t tt m2 {B" , getline (' .' ))
2605+ call assert_equal ([7 , 9 , 16 ], [line (' .' ), col (' .' ), virtcol (' .' )])
2606+
2607+ normal ]maC
2608+ call assert_equal (" \t tt m3 {C" , getline (' .' ))
2609+ call assert_equal ([11 , 9 , 16 ], [line (' .' ), col (' .' ), virtcol (' .' )])
2610+
2611+ normal [maD
2612+ call assert_equal (" \t tt m3 {DC" , getline (' .' ))
2613+ call assert_equal ([11 , 9 , 16 ], [line (' .' ), col (' .' ), virtcol (' .' )])
2614+
2615+ normal k2[maE
2616+ call assert_equal (" \t tt m1 {EA" , getline (' .' ))
2617+ call assert_equal ([3 , 9 , 16 ], [line (' .' ), col (' .' ), virtcol (' .' )])
2618+
2619+ normal 3 [maF
2620+ call assert_equal (" {F" , getline (' .' ))
2621+ call assert_equal ([2 , 2 , 2 ], [line (' .' ), col (' .' ), virtcol (' .' )])
2622+
2623+ normal ]MaG
2624+ call assert_equal (" \t }G e1" , getline (' .' ))
2625+ call assert_equal ([5 , 3 , 10 ], [line (' .' ), col (' .' ), virtcol (' .' )])
2626+
2627+ normal j2]MaH
2628+ call assert_equal (" \t }H e3" , getline (' .' ))
2629+ call assert_equal ([16 , 3 , 10 ], [line (' .' ), col (' .' ), virtcol (' .' )])
2630+
2631+ normal ]M]M
2632+ normal aI
2633+ call assert_equal (" }I" , getline (' .' ))
2634+ call assert_equal ([17 , 2 , 2 ], [line (' .' ), col (' .' ), virtcol (' .' )])
2635+
2636+ normal 2 [MaJ
2637+ call assert_equal (" \t }JH e3" , getline (' .' ))
2638+ call assert_equal ([16 , 3 , 10 ], [line (' .' ), col (' .' ), virtcol (' .' )])
2639+
2640+ normal k [MaK
2641+ call assert_equal (" \t }K e2" , getline (' .' ))
2642+ call assert_equal ([9 , 3 , 10 ], [line (' .' ), col (' .' ), virtcol (' .' )])
2643+
2644+ normal 3 [MaL
2645+ call assert_equal (" {LF" , getline (' .' ))
2646+ call assert_equal ([2 , 2 , 2 ], [line (' .' ), col (' .' ), virtcol (' .' )])
2647+
2648+ close !
2649+ endfunc
0 commit comments