aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_tabpage.vim
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2022-03-14 12:16:12 +0000
committerSean Dewar <seandewar@users.noreply.github.com>2022-03-14 13:10:57 +0000
commit365a9b074f2df3c573ae4a520084818bdd46cd3d (patch)
tree7da2a639663d6c46e57766b5e9cb70a6ccd63c39 /src/nvim/testdir/test_tabpage.vim
parentc5f190e0c21b4e8465502fd9f260c3d49a4102ab (diff)
downloadrneovim-365a9b074f2df3c573ae4a520084818bdd46cd3d.tar.gz
rneovim-365a9b074f2df3c573ae4a520084818bdd46cd3d.tar.bz2
rneovim-365a9b074f2df3c573ae4a520084818bdd46cd3d.zip
vim-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 vim/vim#6677) https://github.com/vim/vim/commit/94f4ffa7704921a3634e56b878e6dc362bc3d508 Do not rename old_curtab to prev_tp in win_new_tabpage, this can be confused with the previous tabpage (`:tabprevious`). Cherry-pick ex_errmsg from v8.2.1280. https://github.com/vim/vim/commit/8930caaa1a283092aca81fdbc3fcf15c7eadb197
Diffstat (limited to 'src/nvim/testdir/test_tabpage.vim')
-rw-r--r--src/nvim/testdir/test_tabpage.vim35
1 files changed, 30 insertions, 5 deletions
diff --git a/src/nvim/testdir/test_tabpage.vim b/src/nvim/testdir/test_tabpage.vim
index b458f9a311..51ab5c1022 100644
--- a/src/nvim/testdir/test_tabpage.vim
+++ b/src/nvim/testdir/test_tabpage.vim
@@ -692,6 +692,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
@@ -716,17 +717,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