summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.1244
blob: d810aa98bbea8cb5a3e73cbb74ba0b0bf9e8c91e (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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1244
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.1244
Problem:    No tests for CTRL-mouse-click.
Solution:   Add a few tests. (Dominique Pelle, closes #4323)
Files:	    src/testdir/test_termcodes.vim


*** ../vim-8.1.1243/src/testdir/test_termcodes.vim	2019-04-28 13:00:08.627933382 +0200
--- src/testdir/test_termcodes.vim	2019-05-01 23:10:28.220053123 +0200
***************
*** 32,37 ****
--- 32,47 ----
    call TerminalEscapeCode(0x21, 1, a:row, a:col, 'M')
  endfunc
  
+ func MouseCtrlLeftClick(row, col)
+   let ctrl = 0x10
+   call TerminalEscapeCode(0x20 + ctrl, 0 + ctrl, a:row, a:col, 'M')
+ endfunc
+ 
+ func MouseCtrlRightClick(row, col)
+   let ctrl = 0x10
+   call TerminalEscapeCode(0x22 + ctrl, 2 + ctrl, a:row, a:col, 'M')
+ endfunc
+ 
  func MouseLeftRelease(row, col)
    call TerminalEscapeCode(0x23, 3, a:row, a:col, 'm')
  endfunc
***************
*** 40,45 ****
--- 50,59 ----
    call TerminalEscapeCode(0x23, 3, a:row, a:col, 'm')
  endfunc
  
+ func MouseRightRelease(row, col)
+   call TerminalEscapeCode(0x23, 3, a:row, a:col, 'm')
+ endfunc
+ 
  func MouseLeftDrag(row, col)
    call TerminalEscapeCode(0x43, 0x20, a:row, a:col, 'M')
  endfunc
***************
*** 62,68 ****
  
    for ttymouse_val in ['xterm2', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
!     exe 'set ttymouse=' . ttymouse_val
      go
      call assert_equal([0, 1, 1, 0], getpos('.'), msg)
      let row = 2
--- 76,82 ----
  
    for ttymouse_val in ['xterm2', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
!     exe 'set ttymouse=' .. ttymouse_val
      go
      call assert_equal([0, 1, 1, 0], getpos('.'), msg)
      let row = 2
***************
*** 78,83 ****
--- 92,130 ----
    bwipe!
  endfunc
  
+ " Test that <C-LeftMouse> jumps to help tag and <C-RightMouse> jumps back.
+ func Test_xterm_mouse_ctrl_click()
+   let save_mouse = &mouse
+   let save_term = &term
+   let save_ttymouse = &ttymouse
+   set mouse=a term=xterm
+ 
+   for ttymouse_val in ['xterm2', 'sgr']
+     let msg = 'ttymouse=' .. ttymouse_val
+     exe 'set ttymouse=' .. ttymouse_val
+     help
+     /usr_02.txt
+     norm! zt
+     let row = 1
+     let col = 1
+     call MouseCtrlLeftClick(row, col)
+     call MouseLeftRelease(row, col)
+     call assert_match('usr_02.txt$', bufname('%'), msg)
+     call assert_equal('*usr_02.txt*', expand('<cWORD>'))
+ 
+     call MouseCtrlRightClick(row, col)
+     call MouseLeftRelease(row, col)
+     call assert_match('help.txt$', bufname('%'), msg)
+     call assert_equal('|usr_02.txt|', expand('<cWORD>'))
+ 
+     helpclose
+   endfor
+ 
+   let &mouse = save_mouse
+   let &term = save_term
+   let &ttymouse = save_ttymouse
+ endfunc
+ 
  func Test_xterm_mouse_middle_click()
    if !WorkingClipboard()
      throw 'Skipped: No working clipboard'
***************
*** 93,99 ****
  
    for ttymouse_val in ['xterm2', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
!     exe 'set ttymouse=' . ttymouse_val
      call setline(1, ['123456789', '123456789'])
  
      " Middle-click in the middle of the line pastes text where clicked.
--- 140,146 ----
  
    for ttymouse_val in ['xterm2', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
!     exe 'set ttymouse=' .. ttymouse_val
      call setline(1, ['123456789', '123456789'])
  
      " Middle-click in the middle of the line pastes text where clicked.
***************
*** 134,140 ****
  
    for ttymouse_val in ['xterm2', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
!     exe 'set ttymouse=' . ttymouse_val
      go
      call assert_equal(1, line('w0'), msg)
      call assert_equal([0, 1, 1, 0], getpos('.'), msg)
--- 181,187 ----
  
    for ttymouse_val in ['xterm2', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
!     exe 'set ttymouse=' .. ttymouse_val
      go
      call assert_equal(1, line('w0'), msg)
      call assert_equal([0, 1, 1, 0], getpos('.'), msg)
***************
*** 170,176 ****
  
    for ttymouse_val in ['xterm2', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
!     exe 'set ttymouse=' . ttymouse_val
  
      " Split horizontally and test dragging the horizontal window separator.
      split
--- 217,223 ----
  
    for ttymouse_val in ['xterm2', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
!     exe 'set ttymouse=' .. ttymouse_val
  
      " Split horizontally and test dragging the horizontal window separator.
      split
***************
*** 227,233 ****
  
    for ttymouse_val in ['xterm2', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
!     exe 'set ttymouse=' . ttymouse_val
  
      call assert_equal(1, &cmdheight, msg)
      let rowstatusline = winheight(0) + 1
--- 274,280 ----
  
    for ttymouse_val in ['xterm2', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
!     exe 'set ttymouse=' .. ttymouse_val
  
      call assert_equal(1, &cmdheight, msg)
      let rowstatusline = winheight(0) + 1
***************
*** 268,274 ****
  
    for ttymouse_val in ['xterm2', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
!     exe 'set ttymouse=' . ttymouse_val
      e Xfoo
      tabnew Xbar
  
--- 315,321 ----
  
    for ttymouse_val in ['xterm2', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
!     exe 'set ttymouse=' .. ttymouse_val
      e Xfoo
      tabnew Xbar
  
***************
*** 320,326 ****
        continue
      endif
      let msg = 'ttymouse=' .. ttymouse_val
!     exe 'set ttymouse=' . ttymouse_val
      e Xtab1
      tabnew Xtab2
      tabnew Xtab3
--- 367,373 ----
        continue
      endif
      let msg = 'ttymouse=' .. ttymouse_val
!     exe 'set ttymouse=' .. ttymouse_val
      e Xtab1
      tabnew Xtab2
      tabnew Xtab3
***************
*** 362,368 ****
  
    for ttymouse_val in ['xterm2', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
!     exe 'set ttymouse=' . ttymouse_val
      e Xtab1
      tabnew Xtab2
  
--- 409,415 ----
  
    for ttymouse_val in ['xterm2', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
!     exe 'set ttymouse=' .. ttymouse_val
      e Xtab1
      tabnew Xtab2
  
***************
*** 411,417 ****
  
    for ttymouse_val in ['xterm2', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
!     exe 'set ttymouse=' . ttymouse_val
      e Xtab1
      tabnew Xtab2
  
--- 458,464 ----
  
    for ttymouse_val in ['xterm2', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
!     exe 'set ttymouse=' .. ttymouse_val
      e Xtab1
      tabnew Xtab2
  
*** ../vim-8.1.1243/src/version.c	2019-05-01 21:43:39.076257243 +0200
--- src/version.c	2019-05-01 23:13:24.447121682 +0200
***************
*** 769,770 ****
--- 769,772 ----
  {   /* Add new patch number below this line */
+ /**/
+     1244,
  /**/

-- 
ARTHUR:   Ni!
BEDEVERE: Nu!
ARTHUR:   No.  Ni!  More like this. "Ni"!
BEDEVERE: Ni, ni, ni!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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    ///