summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.1181
blob: ca8a2e94cd6ba63a7386c8beb5a47b4f6e697de5 (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
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1181
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.1181
Problem:    Tests for mouse clicks are a bit flaky when run in an interactive
            terminal.
Solution:   Use "xterm2" instead of "xterm" for 'ttymouse' to avoid spurious
            drag events.
Files:	    src/testdir/test_termcodes.vim


*** ../vim-8.1.1180/src/testdir/test_termcodes.vim	2019-04-17 16:33:42.795349446 +0200
--- src/testdir/test_termcodes.vim	2019-04-17 17:07:17.373210496 +0200
***************
*** 7,13 ****
  
  " Helper function to emit a terminal escape code.
  func TerminalEscapeCode(code_xterm, code_sgr, row, col, m)
!   if &ttymouse ==# 'xterm'
      " need to use byte encoding here.
      let str = list2str([a:code_xterm, a:col + 0x20, a:row + 0x20])
      if has('iconv')
--- 7,13 ----
  
  " Helper function to emit a terminal escape code.
  func TerminalEscapeCode(code_xterm, code_sgr, row, col, m)
!   if &ttymouse ==# 'xterm2'
      " need to use byte encoding here.
      let str = list2str([a:code_xterm, a:col + 0x20, a:row + 0x20])
      if has('iconv')
***************
*** 50,56 ****
    set mouse=a term=xterm
    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
--- 50,56 ----
    set mouse=a term=xterm
    call setline(1, ['line 1', 'line 2', 'line 3 is a bit longer'])
  
!   for ttymouse_val in ['xterm2', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
      exe 'set ttymouse=' . ttymouse_val
      go
***************
*** 76,82 ****
    set mouse=a term=xterm
    call setline(1, range(1, 100))
  
!   for ttymouse_val in ['xterm', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
      exe 'set ttymouse=' . ttymouse_val
      go
--- 76,82 ----
    set mouse=a term=xterm
    call setline(1, range(1, 100))
  
!   for ttymouse_val in ['xterm2', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
      exe 'set ttymouse=' . ttymouse_val
      go
***************
*** 112,118 ****
    let save_ttymouse = &ttymouse
    set mouse=a term=xterm
  
!   for ttymouse_val in ['xterm', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
      exe 'set ttymouse=' . ttymouse_val
  
--- 112,118 ----
    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
  
***************
*** 122,129 ****
      let row = rowseparator
      let col = 1
  
!     " When 'ttymouse' is 'xterm', row/col bigger than 223 are not supported.
!     if ttymouse_val !=# 'xterm' || row <= 223
        call MouseLeftClick(row, col)
        let row -= 1
        call MouseLeftDrag(row, col)
--- 122,129 ----
      let row = rowseparator
      let col = 1
  
!     " When 'ttymouse' is 'xterm2', row/col bigger than 223 are not supported.
!     if ttymouse_val !=# 'xterm2' || row <= 223
        call MouseLeftClick(row, col)
        let row -= 1
        call MouseLeftDrag(row, col)
***************
*** 142,149 ****
      let row = 1
      let col = colseparator
  
!     " When 'ttymouse' is 'xterm', row/col bigger than 223 are not supported.
!     if ttymouse_val !=# 'xterm' || col <= 223
        call MouseLeftClick(row, col)
        let col -= 1
        call MouseLeftDrag(row, col)
--- 142,149 ----
      let row = 1
      let col = colseparator
  
!     " When 'ttymouse' is 'xterm2', row/col bigger than 223 are not supported.
!     if ttymouse_val !=# 'xterm2' || col <= 223
        call MouseLeftClick(row, col)
        let col -= 1
        call MouseLeftDrag(row, col)
***************
*** 169,175 ****
    let save_laststatus = &laststatus
    set mouse=a term=xterm laststatus=2
  
!   for ttymouse_val in ['xterm', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
      exe 'set ttymouse=' . ttymouse_val
  
--- 169,175 ----
    let save_laststatus = &laststatus
    set mouse=a term=xterm laststatus=2
  
!   for ttymouse_val in ['xterm2', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
      exe 'set ttymouse=' . ttymouse_val
  
***************
*** 178,185 ****
      let row = rowstatusline
      let col = 1
  
!     if ttymouse_val ==# 'xterm' && row > 223
!       " When 'ttymouse' is 'xterm', row/col bigger than 223 are not supported.
        continue
      endif
  
--- 178,185 ----
      let row = rowstatusline
      let col = 1
  
!     if ttymouse_val ==# 'xterm2' && row > 223
!       " When 'ttymouse' is 'xterm2', row/col bigger than 223 are not supported.
        continue
      endif
  
***************
*** 210,216 ****
    set mouse=a term=xterm
    let row = 1
  
!   for ttymouse_val in ['xterm', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
      exe 'set ttymouse=' . ttymouse_val
      e Xfoo
--- 210,216 ----
    set mouse=a term=xterm
    let row = 1
  
!   for ttymouse_val in ['xterm2', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
      exe 'set ttymouse=' . ttymouse_val
      e Xfoo
***************
*** 258,266 ****
    let row = 1
    let col = &columns
  
!   for ttymouse_val in ['xterm', 'sgr']
!     if ttymouse_val ==# 'xterm' && col > 223
!       " When 'ttymouse' is 'xterm', row/col bigger than 223 are not supported.
        continue
      endif
      let msg = 'ttymouse=' .. ttymouse_val
--- 258,266 ----
    let row = 1
    let col = &columns
  
!   for ttymouse_val in ['xterm2', 'sgr']
!     if ttymouse_val ==# 'xterm2' && col > 223
!       " When 'ttymouse' is 'xterm2', row/col bigger than 223 are not supported.
        continue
      endif
      let msg = 'ttymouse=' .. ttymouse_val
***************
*** 304,310 ****
    set mouse=a term=xterm mousetime=1
    let row = 1
  
!   for ttymouse_val in ['xterm', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
      exe 'set ttymouse=' . ttymouse_val
      e Xtab1
--- 304,310 ----
    set mouse=a term=xterm mousetime=1
    let row = 1
  
!   for ttymouse_val in ['xterm2', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
      exe 'set ttymouse=' . ttymouse_val
      e Xtab1
***************
*** 353,359 ****
    let row = 1
    let col = 10
  
!   for ttymouse_val in ['xterm', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
      exe 'set ttymouse=' . ttymouse_val
      e Xtab1
--- 353,359 ----
    let row = 1
    let col = 10
  
!   for ttymouse_val in ['xterm2', 'sgr']
      let msg = 'ttymouse=' .. ttymouse_val
      exe 'set ttymouse=' . ttymouse_val
      e Xtab1
***************
*** 402,408 ****
    let save_term = &term
    let save_ttymouse = &ttymouse
    let save_foldcolumn = &foldcolumn
!   set mouse=a term=xterm foldcolumn=3
  
    " Create 2 nested folds.
    call setline(1, range(1, 7))
--- 402,408 ----
    let save_term = &term
    let save_ttymouse = &ttymouse
    let save_foldcolumn = &foldcolumn
!   set mouse=a term=xterm foldcolumn=3 ttymouse=xterm2
  
    " Create 2 nested folds.
    call setline(1, range(1, 7))
*** ../vim-8.1.1180/src/version.c	2019-04-17 16:53:44.925357857 +0200
--- src/version.c	2019-04-17 17:05:59.709607876 +0200
***************
*** 773,774 ****
--- 773,776 ----
  {   /* Add new patch number below this line */
+ /**/
+     1181,
  /**/

-- 
Life would be so much easier if we could just look at the source code.

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