comparison src/testdir/test_tabpage.vim @ 21727:860cad58f557 v8.2.1413

patch 8.2.1413: previous tab page not usable from an Ex command Commit: https://github.com/vim/vim/commit/94f4ffa7704921a3634e56b878e6dc362bc3d508 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Aug 10 19:21:15 2020 +0200 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)
author Bram Moolenaar <Bram@vim.org>
date Mon, 10 Aug 2020 19:30:04 +0200
parents 22583b9d4efd
children 1503ecd54f8a
comparison
equal deleted inserted replaced
21726:c4d9bcbaf320 21727:860cad58f557
782 tabonly! 782 tabonly!
783 call assert_equal(0, tabpagenr('#')) 783 call assert_equal(0, tabpagenr('#'))
784 call assert_beeps('call feedkeys("g\<Tab>", "xt")') 784 call assert_beeps('call feedkeys("g\<Tab>", "xt")')
785 call assert_beeps('call feedkeys("\<C-Tab>", "xt")') 785 call assert_beeps('call feedkeys("\<C-Tab>", "xt")')
786 call assert_beeps('call feedkeys("\<C-W>g\<Tab>", "xt")') 786 call assert_beeps('call feedkeys("\<C-W>g\<Tab>", "xt")')
787 call assert_fails('tabnext #', 'E475:')
787 788
788 " open four tab pages 789 " open four tab pages
789 tabnew 790 tabnew
790 tabnew 791 tabnew
791 tabnew 792 tabnew
806 " Test for <C-W>g<Tab> 807 " Test for <C-W>g<Tab>
807 call feedkeys("\<C-W>g\<Tab>", "xt") 808 call feedkeys("\<C-W>g\<Tab>", "xt")
808 call assert_equal(4, tabpagenr()) 809 call assert_equal(4, tabpagenr())
809 call assert_equal(2, tabpagenr('#')) 810 call assert_equal(2, tabpagenr('#'))
810 811
812 " Test for :tabnext #
813 tabnext #
814 call assert_equal(2, tabpagenr())
815 call assert_equal(4, tabpagenr('#'))
816
811 " Try to jump to a closed tab page 817 " Try to jump to a closed tab page
812 tabclose 2 818 tabclose #
813 call assert_equal(0, tabpagenr('#')) 819 call assert_equal(0, tabpagenr('#'))
814 call feedkeys("g\<Tab>", "xt") 820 call feedkeys("g\<Tab>", "xt")
815 call assert_equal(3, tabpagenr()) 821 call assert_equal(2, tabpagenr())
816 call feedkeys("\<C-Tab>", "xt") 822 call feedkeys("\<C-Tab>", "xt")
817 call assert_equal(3, tabpagenr()) 823 call assert_equal(2, tabpagenr())
818 call feedkeys("\<C-W>g\<Tab>", "xt") 824 call feedkeys("\<C-W>g\<Tab>", "xt")
819 call assert_equal(3, tabpagenr()) 825 call assert_equal(2, tabpagenr())
820 826 call assert_fails('tabnext #', 'E475:')
821 tabclose! 827 call assert_equal(2, tabpagenr())
828
829 " Test for :tabonly #
830 let wnum = win_getid()
831 $tabnew
832 tabonly #
833 call assert_equal(wnum, win_getid())
834 call assert_equal(1, tabpagenr('$'))
835
836 " Test for :tabmove #
837 tabnew
838 let wnum = win_getid()
839 tabnew
840 tabnew
841 tabnext 2
842 tabmove #
843 call assert_equal(4, tabpagenr())
844 call assert_equal(wnum, win_getid())
845
846 tabonly!
822 endfunc 847 endfunc
823 848
824 " vim: shiftwidth=2 sts=2 expandtab 849 " vim: shiftwidth=2 sts=2 expandtab