summaryrefslogtreecommitdiff
path: root/src/testdir/test_tabpage.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-08-10 19:21:15 +0200
committerBram Moolenaar <Bram@vim.org>2020-08-10 19:21:15 +0200
commit94f4ffa7704921a3634e56b878e6dc362bc3d508 (patch)
tree7eab30ba7523cb0c3261e6c4c0e77f12759937d2 /src/testdir/test_tabpage.vim
parent6e4cfffe809a894ea831fc8011527714481d2857 (diff)
downloadvim-git-94f4ffa7704921a3634e56b878e6dc362bc3d508.tar.gz
patch 8.2.1413: previous tab page not usable from an Ex commandv8.2.1413
Problem: Previous tab page not usable from an Ex command. Solution: Add the "#" argument for :tabnext et al. (Yegappan Lakshmanan, closes #6677)
Diffstat (limited to 'src/testdir/test_tabpage.vim')
-rw-r--r--src/testdir/test_tabpage.vim35
1 files changed, 30 insertions, 5 deletions
diff --git a/src/testdir/test_tabpage.vim b/src/testdir/test_tabpage.vim
index 67469718f..e561064eb 100644
--- a/src/testdir/test_tabpage.vim
+++ b/src/testdir/test_tabpage.vim
@@ -784,6 +784,7 @@ func Test_lastused_tabpage()
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 @@ func Test_lastused_tabpage()
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