comparison src/testdir/test_terminal.vim @ 15937:c38fb03a6055 v8.1.0974

patch 8.1.0974: cannot switch from terminal window to previous tabpage commit https://github.com/vim/vim/commit/882d02eeb571a13a502fe82a04c9eaffa630c294 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Feb 22 17:56:43 2019 +0100 patch 8.1.0974: cannot switch from terminal window to previous tabpage Problem: Cannot switch from terminal window to previous tabpage. Solution: Make CTRL-W gT move to previous tabpage.
author Bram Moolenaar <Bram@vim.org>
date Fri, 22 Feb 2019 18:00:05 +0100
parents b2423b31266f
children 2c18aaf66e77
comparison
equal deleted inserted replaced
15936:8efaa4a54d49 15937:c38fb03a6055
1567 1567
1568 set termwinsize= 1568 set termwinsize=
1569 endfunc 1569 endfunc
1570 1570
1571 func Test_terminal_termwinkey() 1571 func Test_terminal_termwinkey()
1572 call assert_equal(1, winnr('$')) 1572 " make three tabpages, terminal in the middle
1573 0tabnew
1574 tabnext
1575 tabnew
1576 tabprev
1577 call assert_equal(1, winnr('$'))
1578 call assert_equal(2, tabpagenr())
1573 let thiswin = win_getid() 1579 let thiswin = win_getid()
1574 tabnew
1575 tabnext
1576 1580
1577 let buf = Run_shell_in_terminal({}) 1581 let buf = Run_shell_in_terminal({})
1578 let termwin = bufwinid(buf) 1582 let termwin = bufwinid(buf)
1579 set termwinkey=<C-L> 1583 set termwinkey=<C-L>
1580 call feedkeys("\<C-L>w", 'tx') 1584 call feedkeys("\<C-L>w", 'tx')
1581 call assert_equal(thiswin, win_getid()) 1585 call assert_equal(thiswin, win_getid())
1582 call feedkeys("\<C-W>w", 'tx') 1586 call feedkeys("\<C-W>w", 'tx')
1583 call assert_equal(termwin, win_getid()) 1587 call assert_equal(termwin, win_getid())
1584 1588
1585 let tnr = tabpagenr()
1586 call feedkeys("\<C-L>gt", "xt") 1589 call feedkeys("\<C-L>gt", "xt")
1587 call assert_notequal(tnr, tabpagenr()) 1590 call assert_equal(3, tabpagenr())
1591 tabprev
1592 call assert_equal(2, tabpagenr())
1593 call assert_equal(termwin, win_getid())
1594
1595 call feedkeys("\<C-L>gT", "xt")
1596 call assert_equal(1, tabpagenr())
1588 tabnext 1597 tabnext
1589 call assert_equal(tnr, tabpagenr()) 1598 call assert_equal(2, tabpagenr())
1590 call assert_equal(termwin, win_getid()) 1599 call assert_equal(termwin, win_getid())
1591 1600
1592 let job = term_getjob(buf) 1601 let job = term_getjob(buf)
1593 call feedkeys("\<C-L>\<C-C>", 'tx') 1602 call feedkeys("\<C-L>\<C-C>", 'tx')
1594 call WaitForAssert({-> assert_equal("dead", job_status(job))}) 1603 call WaitForAssert({-> assert_equal("dead", job_status(job))})
1595 1604
1596 set termwinkey& 1605 set termwinkey&
1597 tabnext 1606 tabnext
1607 tabclose
1608 tabprev
1598 tabclose 1609 tabclose
1599 endfunc 1610 endfunc
1600 1611
1601 func Test_terminal_out_err() 1612 func Test_terminal_out_err()
1602 if !has('unix') 1613 if !has('unix')