summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.1178
blob: 01a458b6873bc193cdfb0303f71f067e5a489cef (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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1178
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.1178
Problem:    When mouse click tests fails value of 'ttytype' is unknown.
Solution:   Add a message to the assert.
Files:	    src/testdir/test_termcodes.vim


*** ../vim-8.1.1177/src/testdir/test_termcodes.vim	2019-04-15 21:48:19.463316793 +0200
--- src/testdir/test_termcodes.vim	2019-04-17 16:24:40.278144677 +0200
***************
*** 51,64 ****
    call setline(1, ['line 1', 'line 2', 'line 3 is a bit longer'])
  
    for ttymouse_val in ['xterm', 'sgr']
      exe 'set ttymouse=' . ttymouse_val
      go
!     call assert_equal([0, 1, 1, 0], getpos('.'))
      let row = 2
      let col = 6
      call MouseLeftClick(row, col)
      call MouseLeftRelease(row, col)
!     call assert_equal([0, 2, 6, 0], getpos('.'))
    endfor
  
    let &mouse = save_mouse
--- 51,65 ----
    call setline(1, ['line 1', 'line 2', 'line 3 is a bit longer'])
  
    for ttymouse_val in ['xterm', 'sgr']
+     let msg = 'ttymouse=' .. ttymouse_val
      exe 'set ttymouse=' . ttymouse_val
      go
!     call assert_equal([0, 1, 1, 0], getpos('.'), msg)
      let row = 2
      let col = 6
      call MouseLeftClick(row, col)
      call MouseLeftRelease(row, col)
!     call assert_equal([0, 2, 6, 0], getpos('.'), msg)
    endfor
  
    let &mouse = save_mouse
***************
*** 76,101 ****
    call setline(1, range(1, 100))
  
    for ttymouse_val in ['xterm', 'sgr']
      exe 'set ttymouse=' . ttymouse_val
      go
!     call assert_equal(1, line('w0'))
!     call assert_equal([0, 1, 1, 0], getpos('.'))
  
      call MouseWheelDown(1, 1)
!     call assert_equal(4, line('w0'))
!     call assert_equal([0, 4, 1, 0], getpos('.'))
  
      call MouseWheelDown(1, 1)
!     call assert_equal(7, line('w0'))
!     call assert_equal([0, 7, 1, 0], getpos('.'))
  
      call MouseWheelUp(1, 1)
!     call assert_equal(4, line('w0'))
!     call assert_equal([0, 7, 1, 0], getpos('.'))
  
      call MouseWheelUp(1, 1)
!     call assert_equal(1, line('w0'))
!     call assert_equal([0, 7, 1, 0], getpos('.'))
    endfor
  
    let &mouse = save_mouse
--- 77,103 ----
    call setline(1, range(1, 100))
  
    for ttymouse_val in ['xterm', '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)
  
      call MouseWheelDown(1, 1)
!     call assert_equal(4, line('w0'), msg)
!     call assert_equal([0, 4, 1, 0], getpos('.'), msg)
  
      call MouseWheelDown(1, 1)
!     call assert_equal(7, line('w0'), msg)
!     call assert_equal([0, 7, 1, 0], getpos('.'), msg)
  
      call MouseWheelUp(1, 1)
!     call assert_equal(4, line('w0'), msg)
!     call assert_equal([0, 7, 1, 0], getpos('.'), msg)
  
      call MouseWheelUp(1, 1)
!     call assert_equal(1, line('w0'), msg)
!     call assert_equal([0, 7, 1, 0], getpos('.'), msg)
    endfor
  
    let &mouse = save_mouse
***************
*** 111,116 ****
--- 113,119 ----
    set mouse=a term=xterm
  
    for ttymouse_val in ['xterm', 'sgr']
+     let msg = 'ttymouse=' .. ttymouse_val
      exe 'set ttymouse=' . ttymouse_val
  
      " Split horizontally and test dragging the horizontal window separator.
***************
*** 124,135 ****
        call MouseLeftClick(row, col)
        let row -= 1
        call MouseLeftDrag(row, col)
!       call assert_equal(rowseparator - 1, winheight(0) + 1)
        let row += 1
        call MouseLeftDrag(row, col)
!       call assert_equal(rowseparator, winheight(0) + 1)
        call MouseLeftRelease(row, col)
!       call assert_equal(rowseparator, winheight(0) + 1)
      endif
      bwipe!
  
--- 127,138 ----
        call MouseLeftClick(row, col)
        let row -= 1
        call MouseLeftDrag(row, col)
!       call assert_equal(rowseparator - 1, winheight(0) + 1, msg)
        let row += 1
        call MouseLeftDrag(row, col)
!       call assert_equal(rowseparator, winheight(0) + 1, msg)
        call MouseLeftRelease(row, col)
!       call assert_equal(rowseparator, winheight(0) + 1, msg)
      endif
      bwipe!
  
***************
*** 144,155 ****
        call MouseLeftClick(row, col)
        let col -= 1
        call MouseLeftDrag(row, col)
!       call assert_equal(colseparator - 1, winwidth(0) + 1)
        let col += 1
        call MouseLeftDrag(row, col)
!       call assert_equal(colseparator, winwidth(0) + 1)
        call MouseLeftRelease(row, col)
!       call assert_equal(colseparator, winwidth(0) + 1)
      endif
      bwipe!
    endfor
--- 147,158 ----
        call MouseLeftClick(row, col)
        let col -= 1
        call MouseLeftDrag(row, col)
!       call assert_equal(colseparator - 1, winwidth(0) + 1, msg)
        let col += 1
        call MouseLeftDrag(row, col)
!       call assert_equal(colseparator, winwidth(0) + 1, msg)
        call MouseLeftRelease(row, col)
!       call assert_equal(colseparator, winwidth(0) + 1, msg)
      endif
      bwipe!
    endfor
***************
*** 167,175 ****
    set mouse=a term=xterm laststatus=2
  
    for ttymouse_val in ['xterm', 'sgr']
      exe 'set ttymouse=' . ttymouse_val
  
!     call assert_equal(1, &cmdheight)
      let rowstatusline = winheight(0) + 1
      let row = rowstatusline
      let col = 1
--- 170,179 ----
    set mouse=a term=xterm laststatus=2
  
    for ttymouse_val in ['xterm', 'sgr']
+     let msg = 'ttymouse=' .. ttymouse_val
      exe 'set ttymouse=' . ttymouse_val
  
!     call assert_equal(1, &cmdheight, msg)
      let rowstatusline = winheight(0) + 1
      let row = rowstatusline
      let col = 1
***************
*** 182,196 ****
      call MouseLeftClick(row, col)
      let row -= 1
      call MouseLeftDrag(row, col)
!     call assert_equal(2, &cmdheight)
!     call assert_equal(rowstatusline - 1, winheight(0) + 1)
      let row += 1
      call MouseLeftDrag(row, col)
!     call assert_equal(1, &cmdheight)
!     call assert_equal(rowstatusline, winheight(0) + 1)
      call MouseLeftRelease(row, col)
!     call assert_equal(1, &cmdheight)
!     call assert_equal(rowstatusline, winheight(0) + 1)
    endfor
  
    let &mouse = save_mouse
--- 186,200 ----
      call MouseLeftClick(row, col)
      let row -= 1
      call MouseLeftDrag(row, col)
!     call assert_equal(2, &cmdheight, msg)
!     call assert_equal(rowstatusline - 1, winheight(0) + 1, msg)
      let row += 1
      call MouseLeftDrag(row, col)
!     call assert_equal(1, &cmdheight, msg)
!     call assert_equal(rowstatusline, winheight(0) + 1, msg)
      call MouseLeftRelease(row, col)
!     call assert_equal(1, &cmdheight, msg)
!     call assert_equal(rowstatusline, winheight(0) + 1, msg)
    endfor
  
    let &mouse = save_mouse
***************
*** 207,212 ****
--- 211,217 ----
    let row = 1
  
    for ttymouse_val in ['xterm', 'sgr']
+     let msg = 'ttymouse=' .. ttymouse_val
      exe 'set ttymouse=' . ttymouse_val
      e Xfoo
      tabnew Xbar
***************
*** 215,221 ****
      call assert_equal(['Tab page 1',
          \              '    Xfoo',
          \              'Tab page 2',
!         \              '>   Xbar'], a)
  
      " Test clicking on tab names in the tabline at the top.
      let col = 2
--- 220,226 ----
      call assert_equal(['Tab page 1',
          \              '    Xfoo',
          \              'Tab page 2',
!         \              '>   Xbar'], a, msg)
  
      " Test clicking on tab names in the tabline at the top.
      let col = 2
***************
*** 226,232 ****
      call assert_equal(['Tab page 1',
          \              '>   Xfoo',
          \              'Tab page 2',
!         \              '    Xbar'], a)
  
      let col = 9
      call MouseLeftClick(row, col)
--- 231,237 ----
      call assert_equal(['Tab page 1',
          \              '>   Xfoo',
          \              'Tab page 2',
!         \              '    Xbar'], a, msg)
  
      let col = 9
      call MouseLeftClick(row, col)
***************
*** 235,241 ****
      call assert_equal(['Tab page 1',
          \              '    Xfoo',
          \              'Tab page 2',
!         \              '>   Xbar'], a)
  
      %bwipe!
    endfor
--- 240,246 ----
      call assert_equal(['Tab page 1',
          \              '    Xfoo',
          \              'Tab page 2',
!         \              '>   Xbar'], a, msg)
  
      %bwipe!
    endfor
***************
*** 258,263 ****
--- 263,269 ----
        " When 'ttymouse' is 'xterm', row/col bigger than 223 are not supported.
        continue
      endif
+     let msg = 'ttymouse=' .. ttymouse_val
      exe 'set ttymouse=' . ttymouse_val
      e Xtab1
      tabnew Xtab2
***************
*** 270,276 ****
          \              'Tab page 2',
          \              '>   Xtab2',
          \              'Tab page 3',
!         \              '    Xtab3'], a)
  
      " Click on "X" in tabline to close current tab i.e. Xtab2.
      redraw
--- 276,282 ----
          \              'Tab page 2',
          \              '>   Xtab2',
          \              'Tab page 3',
!         \              '    Xtab3'], a, msg)
  
      " Click on "X" in tabline to close current tab i.e. Xtab2.
      redraw
***************
*** 280,286 ****
      call assert_equal(['Tab page 1',
          \              '    Xtab1',
          \              'Tab page 2',
!         \              '>   Xtab3'], a)
  
      %bwipe!
    endfor
--- 286,292 ----
      call assert_equal(['Tab page 1',
          \              '    Xtab1',
          \              'Tab page 2',
!         \              '>   Xtab3'], a, msg)
  
      %bwipe!
    endfor
***************
*** 299,304 ****
--- 305,311 ----
    let row = 1
  
    for ttymouse_val in ['xterm', 'sgr']
+     let msg = 'ttymouse=' .. ttymouse_val
      exe 'set ttymouse=' . ttymouse_val
      e Xtab1
      tabnew Xtab2
***************
*** 307,320 ****
      call assert_equal(['Tab page 1',
          \              '    Xtab1',
          \              'Tab page 2',
!         \              '>   Xtab2'], a)
      redraw
  
      " Click in tab2 and drag it to tab1.
      " Check getcharmod() to verify that click is not
      " interpreted as a spurious double-click.
      call MouseLeftClick(row, 10)
!     call assert_equal(0, getcharmod())
      for col in [9, 8, 7, 6]
        call MouseLeftDrag(row, col)
      endfor
--- 314,327 ----
      call assert_equal(['Tab page 1',
          \              '    Xtab1',
          \              'Tab page 2',
!         \              '>   Xtab2'], a, msg)
      redraw
  
      " Click in tab2 and drag it to tab1.
      " Check getcharmod() to verify that click is not
      " interpreted as a spurious double-click.
      call MouseLeftClick(row, 10)
!     call assert_equal(0, getcharmod(), msg)
      for col in [9, 8, 7, 6]
        call MouseLeftDrag(row, col)
      endfor
***************
*** 323,329 ****
      call assert_equal(['Tab page 1',
          \              '>   Xtab2',
          \              'Tab page 2',
!         \              '    Xtab1'], a)
  
      " brief sleep to avoid causing a double-click
      sleep 20m
--- 330,336 ----
      call assert_equal(['Tab page 1',
          \              '>   Xtab2',
          \              'Tab page 2',
!         \              '    Xtab1'], a, msg)
  
      " brief sleep to avoid causing a double-click
      sleep 20m
***************
*** 347,352 ****
--- 354,360 ----
    let col = 10
  
    for ttymouse_val in ['xterm', 'sgr']
+     let msg = 'ttymouse=' .. ttymouse_val
      exe 'set ttymouse=' . ttymouse_val
      e Xtab1
      tabnew Xtab2
***************
*** 355,370 ****
      call assert_equal(['Tab page 1',
          \              '    Xtab1',
          \              'Tab page 2',
!         \              '>   Xtab2'], a)
  
      redraw
      call MouseLeftClick(row, col)
      " Check getcharmod() to verify that first click is not
      " interpreted as a spurious double-click.
!     call assert_equal(0, getcharmod())
      call MouseLeftRelease(row, col)
      call MouseLeftClick(row, col)
!     call assert_equal(32, getcharmod()) " double-click
      call MouseLeftRelease(row, col)
      let a = split(execute(':tabs'), "\n")
      call assert_equal(['Tab page 1',
--- 363,378 ----
      call assert_equal(['Tab page 1',
          \              '    Xtab1',
          \              'Tab page 2',
!         \              '>   Xtab2'], a, msg)
  
      redraw
      call MouseLeftClick(row, col)
      " Check getcharmod() to verify that first click is not
      " interpreted as a spurious double-click.
!     call assert_equal(0, getcharmod(), msg)
      call MouseLeftRelease(row, col)
      call MouseLeftClick(row, col)
!     call assert_equal(32, getcharmod(), msg) " double-click
      call MouseLeftRelease(row, col)
      let a = split(execute(':tabs'), "\n")
      call assert_equal(['Tab page 1',
***************
*** 372,378 ****
          \              'Tab page 2',
          \              '>   [No Name]',
          \              'Tab page 3',
!         \              '    Xtab2'], a)
  
      if ttymouse_val !=# 'sgr'
        " We need to sleep, or else MouseLeftClick() in next loop
--- 380,386 ----
          \              'Tab page 2',
          \              '>   [No Name]',
          \              'Tab page 3',
!         \              '    Xtab2'], a, msg)
  
      if ttymouse_val !=# 'sgr'
        " We need to sleep, or else MouseLeftClick() in next loop
*** ../vim-8.1.1177/src/version.c	2019-04-16 22:21:00.042595439 +0200
--- src/version.c	2019-04-17 16:26:22.281621305 +0200
***************
*** 773,774 ****
--- 773,776 ----
  {   /* Add new patch number below this line */
+ /**/
+     1178,
  /**/

-- 
       He was not in the least bit scared to be mashed into a pulp
       Or to have his eyes gouged out and his elbows broken;
       To have his kneecaps split and his body burned away
       And his limbs all hacked and mangled, brave Sir Robin.
                 "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    ///