summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0974
blob: 3fe65fbedd62eb7364b4144977162e541fb7901f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0974
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0974
Problem:    Cannot switch from terminal window to previous tabpage.
Solution:   Make CTRL-W gT move to previous tabpage.
Files:	    src/window.c, src/testdir/test_terminal.vim,
            runtime/doc/terminal.txt


*** ../vim-8.1.0973/src/window.c	2019-02-22 16:09:06.578746015 +0100
--- src/window.c	2019-02-22 17:39:19.674664417 +0100
***************
*** 87,96 ****
  #endif
      char_u	cbuf[40];
  
!     if (Prenum == 0)
! 	Prenum1 = 1;
!     else
! 	Prenum1 = Prenum;
  
  #ifdef FEAT_CMDWIN
  # define CHECK_CMDWIN \
--- 87,93 ----
  #endif
      char_u	cbuf[40];
  
!     Prenum1 = Prenum == 0 ? 1 : Prenum;
  
  #ifdef FEAT_CMDWIN
  # define CHECK_CMDWIN \
***************
*** 588,593 ****
--- 585,594 ----
  			goto_tabpage((int)Prenum);
  			break;
  
+ 		    case 'T':	    // CTRL-W gT: go to previous tab page
+ 			goto_tabpage(-(int)Prenum1);
+ 			break;
+ 
  		    default:
  			beep_flush();
  			break;
*** ../vim-8.1.0973/src/testdir/test_terminal.vim	2019-02-22 16:09:06.578746015 +0100
--- src/testdir/test_terminal.vim	2019-02-22 17:51:42.925520407 +0100
***************
*** 1569,1578 ****
  endfunc
  
  func Test_terminal_termwinkey()
    call assert_equal(1, winnr('$'))
    let thiswin = win_getid()
-   tabnew
-   tabnext
  
    let buf = Run_shell_in_terminal({})
    let termwin = bufwinid(buf)
--- 1569,1582 ----
  endfunc
  
  func Test_terminal_termwinkey()
+   " 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,1592 ****
    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())
    tabnext
!   call assert_equal(tnr, tabpagenr())
    call assert_equal(termwin, win_getid())
  
    let job = term_getjob(buf)
--- 1586,1601 ----
    call feedkeys("\<C-W>w", 'tx')
    call assert_equal(termwin, win_getid())
  
    call feedkeys("\<C-L>gt", "xt")
!   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(2, tabpagenr())
    call assert_equal(termwin, win_getid())
  
    let job = term_getjob(buf)
***************
*** 1596,1601 ****
--- 1605,1612 ----
    set termwinkey&
    tabnext
    tabclose
+   tabprev
+   tabclose
  endfunc
  
  func Test_terminal_out_err()
*** ../vim-8.1.0973/runtime/doc/terminal.txt	2019-02-22 16:09:06.578746015 +0100
--- runtime/doc/terminal.txt	2019-02-22 17:41:35.569722575 +0100
***************
*** 44,50 ****
  
  {Vi does not have any of these commands}
  {only available when compiled with the |+terminal| feature}
! The terminal feature requires the |+multi_byte|, |+job| and |+channel| features.
  
  ==============================================================================
  1. Basic use						*terminal-use*
--- 44,50 ----
  
  {Vi does not have any of these commands}
  {only available when compiled with the |+terminal| feature}
! The terminal feature requires the |+job| and |+channel| features.
  
  ==============================================================================
  1. Basic use						*terminal-use*
***************
*** 81,86 ****
--- 81,87 ----
  			evaluating an expression.
  	CTRL-W CTRL-C	ends the job, see below |t_CTRL-W_CTRL-C|
  	CTRL-W gt	go to next tabpage, same as `gt`
+ 	CTRL-W gT	go to previous tabpage, same as `gT`
  
  See option 'termwinkey' for specifying another key instead of CTRL-W that
  will work like CTRL-W.  However, typing 'termwinkey' twice sends 'termwinkey'
*** ../vim-8.1.0973/src/version.c	2019-02-22 17:26:57.739029029 +0100
--- src/version.c	2019-02-22 17:52:10.157342450 +0100
***************
*** 781,782 ****
--- 781,784 ----
  {   /* Add new patch number below this line */
+ /**/
+     974,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
17. You turn on your intercom when leaving the room so you can hear if new
    e-mail arrives.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///