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
|
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1272
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.1272
Problem: Click on WinBar of other window not tested.
Solution: Add a test case.
Files: src/testdir/test_winbar.vim
*** ../vim-8.1.1271/src/testdir/test_winbar.vim 2019-05-04 17:30:02.498806639 +0200
--- src/testdir/test_winbar.vim 2019-05-05 13:13:01.676081521 +0200
***************
*** 27,46 ****
close
endfunc
! func Test_click_in_winbar()
! new
amenu 1.10 WinBar.Next :let g:did_next = 11<CR>
amenu 1.20 WinBar.Cont :let g:did_cont = 12<CR>
amenu 1.30 WinBar.Close :close<CR>
redraw
call assert_match('Next Cont Close', Screenline(1))
let save_mouse = &mouse
set mouse=a
- " Columns of the button edges:
- " _Next_ _Cont_ _Close_
- " 2 7 10 15 18 24
let g:did_next = 0
let g:did_cont = 0
for col in [1, 8, 9, 16, 17, 25, 26]
--- 27,50 ----
close
endfunc
! " Create a WinBar with three buttons.
! " Columns of the button edges:
! " _Next_ _Cont_ _Close_
! " 2 7 10 15 18 24
! func SetupWinbar()
amenu 1.10 WinBar.Next :let g:did_next = 11<CR>
amenu 1.20 WinBar.Cont :let g:did_cont = 12<CR>
amenu 1.30 WinBar.Close :close<CR>
redraw
call assert_match('Next Cont Close', Screenline(1))
+ endfunc
+ func Test_click_in_winbar()
+ new
+ call SetupWinbar()
let save_mouse = &mouse
set mouse=a
let g:did_next = 0
let g:did_cont = 0
for col in [1, 8, 9, 16, 17, 25, 26]
***************
*** 71,73 ****
--- 75,112 ----
let &mouse = save_mouse
endfunc
+
+ func Test_click_in_other_winbar()
+ new
+ call SetupWinbar()
+ let save_mouse = &mouse
+ set mouse=a
+ let winid = win_getid()
+
+ split
+ let [row, col] = win_screenpos(winid)
+
+ " Click on Next button in other window
+ let g:did_next = 0
+ call test_setmouse(row, 5)
+ call feedkeys("\<LeftMouse>", "xt")
+ call assert_equal(11, g:did_next)
+
+ " Click on Cont button in other window from Visual mode
+ let g:did_cont = 0
+ call setline(1, 'select XYZ here')
+ call test_setmouse(row, 12)
+ call feedkeys("0fXvfZ\<LeftMouse>x", "xt")
+ call assert_equal(12, g:did_cont)
+ call assert_equal('select here', getline(1))
+
+ " Click on Close button in other window
+ let wincount = winnr('$')
+ let winid = win_getid()
+ call test_setmouse(row, 20)
+ call feedkeys("\<LeftMouse>", "xt")
+ call assert_equal(wincount - 1, winnr('$'))
+ call assert_equal(winid, win_getid())
+
+ bwipe!
+ endfunc
*** ../vim-8.1.1271/src/version.c 2019-05-05 13:02:05.659655348 +0200
--- src/version.c 2019-05-05 13:13:39.827873300 +0200
***************
*** 769,770 ****
--- 769,772 ----
{ /* Add new patch number below this line */
+ /**/
+ 1272,
/**/
--
BEDEVERE: Look! It's the old man from scene 24 - what's he Doing here?
ARTHUR: He is the keeper of the Bridge. He asks each traveler five
questions ...
GALAHAD: Three questions.
"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 ///
|