comparison src/testdir/test_termcodes.vim @ 16275:ed5172ae1c32 v8.1.1142

patch 8.1.1142: no test for dragging the window separators with the mouse commit https://github.com/vim/vim/commit/3fb01a53c685d8d7e7bd83c33500de80aed0d7c8 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Apr 9 21:52:02 2019 +0200 patch 8.1.1142: no test for dragging the window separators with the mouse Problem: No test for dragging the window separators with the mouse. Solution: Add a test. (Dominique Pelle, closes https://github.com/vim/vim/issues/4226)
author Bram Moolenaar <Bram@vim.org>
date Tue, 09 Apr 2019 22:00:05 +0200
parents 7feb5b90be5f
children f3d579f009d1
comparison
equal deleted inserted replaced
16274:06c4d15f4a26 16275:ed5172ae1c32
109 let &mouse = save_mouse 109 let &mouse = save_mouse
110 let &term = save_term 110 let &term = save_term
111 let &ttymouse = save_ttymouse 111 let &ttymouse = save_ttymouse
112 bwipe! 112 bwipe!
113 endfunc 113 endfunc
114
115 func Test_xterm_mouse_drag_window_separator()
116 let save_mouse = &mouse
117 let save_term = &term
118 let save_ttymouse = &ttymouse
119 set mouse=a
120 set term=xterm
121 set ttymouse=sgr
122
123 " Split horizontally and test dragging the horizontal window separator.
124 split
125 let rowseparator = winheight(0) + 1
126
127 let button = 0 " left down.
128 let row = rowseparator
129 let col = 1
130 call feedkeys(printf("\<Esc>[<%d;%d;%dM", button, col, row), 'Lx!')
131
132 let drag = 32
133 let row -= 1
134 call feedkeys(printf("\<Esc>[<%d;%d;%dM", drag, col, row), 'Lx!')
135 call assert_equal(rowseparator - 1, winheight(0) + 1)
136 let row += 1
137 call feedkeys(printf("\<Esc>[<%d;%d;%dM", drag, col, row), 'Lx!')
138 call assert_equal(rowseparator, winheight(0) + 1)
139
140 let release = 3
141 call feedkeys(printf("\<Esc>[<%d;%d;%dm", release, col, row), 'Lx!')
142 call assert_equal(rowseparator, winheight(0) + 1)
143
144 bwipe!
145
146 " Split vertically and test dragging the vertical window separator.
147 vsplit
148 let colseparator = winwidth(0) + 1
149
150 let button = 0
151 let row = 1
152 let col = colseparator
153 call feedkeys(printf("\<Esc>[<%d;%d;%dM", button, col, row), 'Lx!')
154
155 let drag = 32
156 let col -= 1
157 call feedkeys(printf("\<Esc>[<%d;%d;%dM", drag, col, row), 'Lx!')
158 call assert_equal(colseparator - 1, winwidth(0) + 1)
159 let col += 1
160 call feedkeys(printf("\<Esc>[<%d;%d;%dM", drag, col, row), 'Lx!')
161 call assert_equal(colseparator, winwidth(0) + 1)
162
163 let release = 3
164 call feedkeys(printf("\<Esc>[<%d;%d;%dm", release, col, row), 'Lx!')
165 call assert_equal(colseparator, winwidth(0) + 1)
166
167 bwipe!
168 let &mouse = save_mouse
169 let &term = save_term
170 let &ttymouse = save_ttymouse
171 endfunc