@@ -186,4 +186,36 @@ function Test_tabpage_with_autocmd()
186186 bw !
187187endfunction
188188
189+ function Test_tabpage_with_tab_modifier ()
190+ for n in range (4 )
191+ tabedit
192+ endfor
193+
194+ function s: check_tab (pre_nr, cmd, post_nr)
195+ exec ' tabnext ' . a: pre_nr
196+ exec a: cmd
197+ call assert_equal (a: post_nr , tabpagenr ())
198+ call assert_equal (' help' , &filetype )
199+ helpclose
200+ endfunc
201+
202+ call s: check_tab (1 , ' tab help' , 2 )
203+ call s: check_tab (1 , ' 3tab help' , 4 )
204+ call s: check_tab (1 , ' .tab help' , 2 )
205+ call s: check_tab (1 , ' .+1tab help' , 3 )
206+ call s: check_tab (1 , ' 0tab help' , 1 )
207+ call s: check_tab (2 , ' +tab help' , 4 )
208+ call s: check_tab (2 , ' +2tab help' , 5 )
209+ call s: check_tab (4 , ' -tab help' , 4 )
210+ call s: check_tab (4 , ' -2tab help' , 3 )
211+ call s: check_tab (3 , ' $tab help' , 6 )
212+ call assert_fails (' 99tab help' , ' E16:' )
213+ call assert_fails (' +99tab help' , ' E16:' )
214+ call assert_fails (' -99tab help' , ' E16:' )
215+
216+ delfunction s: check_tab
217+ tabonly !
218+ bw !
219+ endfunction
220+
189221" vim: shiftwidth = 2 sts = 2 expandtab
0 commit comments