patch 8.2.1413: previous tab page not usable from an Ex command
Problem: Previous tab page not usable from an Ex command.
Solution: Add the "#" argument for :tabnext et al. (Yegappan Lakshmanan,
closes #6677)
diff --git a/src/testdir/test_tabpage.vim b/src/testdir/test_tabpage.vim
index 6746971..e561064 100644
--- a/src/testdir/test_tabpage.vim
+++ b/src/testdir/test_tabpage.vim
@@ -784,6 +784,7 @@
call assert_beeps('call feedkeys("g\<Tab>", "xt")')
call assert_beeps('call feedkeys("\<C-Tab>", "xt")')
call assert_beeps('call feedkeys("\<C-W>g\<Tab>", "xt")')
+ call assert_fails('tabnext #', 'E475:')
" open four tab pages
tabnew
@@ -808,17 +809,41 @@
call assert_equal(4, tabpagenr())
call assert_equal(2, tabpagenr('#'))
+ " Test for :tabnext #
+ tabnext #
+ call assert_equal(2, tabpagenr())
+ call assert_equal(4, tabpagenr('#'))
+
" Try to jump to a closed tab page
- tabclose 2
+ tabclose #
call assert_equal(0, tabpagenr('#'))
call feedkeys("g\<Tab>", "xt")
- call assert_equal(3, tabpagenr())
+ call assert_equal(2, tabpagenr())
call feedkeys("\<C-Tab>", "xt")
- call assert_equal(3, tabpagenr())
+ call assert_equal(2, tabpagenr())
call feedkeys("\<C-W>g\<Tab>", "xt")
- call assert_equal(3, tabpagenr())
+ call assert_equal(2, tabpagenr())
+ call assert_fails('tabnext #', 'E475:')
+ call assert_equal(2, tabpagenr())
- tabclose!
+ " Test for :tabonly #
+ let wnum = win_getid()
+ $tabnew
+ tabonly #
+ call assert_equal(wnum, win_getid())
+ call assert_equal(1, tabpagenr('$'))
+
+ " Test for :tabmove #
+ tabnew
+ let wnum = win_getid()
+ tabnew
+ tabnew
+ tabnext 2
+ tabmove #
+ call assert_equal(4, tabpagenr())
+ call assert_equal(wnum, win_getid())
+
+ tabonly!
endfunc
" vim: shiftwidth=2 sts=2 expandtab