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.
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim
index ee50b57..e5a7be5 100644
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -1569,10 +1569,14 @@
endfunc
func Test_terminal_termwinkey()
- call assert_equal(1, winnr('$'))
- let thiswin = win_getid()
- tabnew
+ " make three tabpages, terminal in the middle
+ 0tabnew
tabnext
+ tabnew
+ tabprev
+ call assert_equal(1, winnr('$'))
+ call assert_equal(2, tabpagenr())
+ let thiswin = win_getid()
let buf = Run_shell_in_terminal({})
let termwin = bufwinid(buf)
@@ -1582,11 +1586,16 @@
call feedkeys("\<C-W>w", 'tx')
call assert_equal(termwin, win_getid())
- let tnr = tabpagenr()
call feedkeys("\<C-L>gt", "xt")
- call assert_notequal(tnr, tabpagenr())
+ call assert_equal(3, tabpagenr())
+ tabprev
+ call assert_equal(2, tabpagenr())
+ call assert_equal(termwin, win_getid())
+
+ call feedkeys("\<C-L>gT", "xt")
+ call assert_equal(1, tabpagenr())
tabnext
- call assert_equal(tnr, tabpagenr())
+ call assert_equal(2, tabpagenr())
call assert_equal(termwin, win_getid())
let job = term_getjob(buf)
@@ -1596,6 +1605,8 @@
set termwinkey&
tabnext
tabclose
+ tabprev
+ tabclose
endfunc
func Test_terminal_out_err()