summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.1142
blob: cc682305e193aaa5d006811382f5d4f9ace93bd0 (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
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1142
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.1142
Problem:    No test for dragging the window separators with the mouse.
Solution:   Add a test. (Dominique Pelle, closes #4226)
Files:	    src/testdir/test_termcodes.vim


*** ../vim-8.1.1141/src/testdir/test_termcodes.vim	2019-04-07 21:55:03.732116294 +0200
--- src/testdir/test_termcodes.vim	2019-04-09 21:49:50.990047878 +0200
***************
*** 111,113 ****
--- 111,171 ----
    let &ttymouse = save_ttymouse
    bwipe!
  endfunc
+ 
+ func Test_xterm_mouse_drag_window_separator()
+   let save_mouse = &mouse
+   let save_term = &term
+   let save_ttymouse = &ttymouse
+   set mouse=a
+   set term=xterm
+   set ttymouse=sgr
+ 
+   " Split horizontally and test dragging the horizontal window separator.
+   split
+   let rowseparator = winheight(0) + 1
+ 
+   let button = 0  " left down.
+   let row = rowseparator
+   let col = 1
+   call feedkeys(printf("\<Esc>[<%d;%d;%dM", button, col, row), 'Lx!')
+ 
+   let drag = 32
+   let row -= 1
+   call feedkeys(printf("\<Esc>[<%d;%d;%dM", drag, col, row), 'Lx!')
+   call assert_equal(rowseparator - 1, winheight(0) + 1)
+   let row += 1
+   call feedkeys(printf("\<Esc>[<%d;%d;%dM", drag, col, row), 'Lx!')
+   call assert_equal(rowseparator, winheight(0) + 1)
+ 
+   let release = 3
+   call feedkeys(printf("\<Esc>[<%d;%d;%dm", release, col, row), 'Lx!')
+   call assert_equal(rowseparator, winheight(0) + 1)
+ 
+   bwipe!
+ 
+   " Split vertically and test dragging the vertical window separator.
+   vsplit
+   let colseparator = winwidth(0) + 1
+ 
+   let button = 0
+   let row = 1
+   let col = colseparator
+   call feedkeys(printf("\<Esc>[<%d;%d;%dM", button, col, row), 'Lx!')
+ 
+   let drag = 32
+   let col -= 1
+   call feedkeys(printf("\<Esc>[<%d;%d;%dM", drag, col, row), 'Lx!')
+   call assert_equal(colseparator - 1, winwidth(0) + 1)
+   let col += 1
+   call feedkeys(printf("\<Esc>[<%d;%d;%dM", drag, col, row), 'Lx!')
+   call assert_equal(colseparator, winwidth(0) + 1)
+ 
+   let release = 3
+   call feedkeys(printf("\<Esc>[<%d;%d;%dm", release, col, row), 'Lx!')
+   call assert_equal(colseparator, winwidth(0) + 1)
+ 
+   bwipe!
+   let &mouse = save_mouse
+   let &term = save_term
+   let &ttymouse = save_ttymouse
+ endfunc
*** ../vim-8.1.1141/src/version.c	2019-04-09 21:17:28.837660254 +0200
--- src/version.c	2019-04-09 21:51:24.301503517 +0200
***************
*** 773,774 ****
--- 773,776 ----
  {   /* Add new patch number below this line */
+ /**/
+     1142,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
238. You think faxes are old-fashioned.

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