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
|
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1179
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.1179
Problem: No test for mouse clicks in the fold column.
Solution: Add a test. (Dominique Pelle, closes #4261)
Files: src/testdir/test_termcodes.vim
*** ../vim-8.1.1178/src/testdir/test_termcodes.vim 2019-04-17 16:26:57.677439389 +0200
--- src/testdir/test_termcodes.vim 2019-04-17 16:30:54.844217343 +0200
***************
*** 395,397 ****
--- 395,448 ----
let &ttymouse = save_ttymouse
set mousetime&
endfunc
+
+ func Test_xterm_mouse_click_in_fold_columns()
+ new
+ let save_mouse = &mouse
+ 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))
+ 2,6fold
+ norm! zR
+ 4,5fold
+ call assert_equal([-1, -1, -1, 4, 4, -1, -1],
+ \ map(range(1, 7), 'foldclosed(v:val)'))
+
+ " Click in "+" of inner fold in foldcolumn should open it.
+ redraw
+ let row = 4
+ let col = 2
+ call MouseLeftClick(row, col)
+ call MouseLeftRelease(row, col)
+ call assert_equal([-1, -1, -1, -1, -1, -1, -1],
+ \ map(range(1, 7), 'foldclosed(v:val)'))
+
+ " Click in "-" of outer fold in foldcolumn should close it.
+ redraw
+ let row = 2
+ let col = 1
+ call MouseLeftClick(row, col)
+ call MouseLeftRelease(row, col)
+ call assert_equal([-1, 2, 2, 2, 2, 2, -1],
+ \ map(range(1, 7), 'foldclosed(v:val)'))
+ norm! zR
+
+ " Click in "|" of inner fold in foldcolumn should close it.
+ redraw
+ let row = 5
+ let col = 2
+ call MouseLeftClick(row, col)
+ call MouseLeftRelease(row, col)
+ call assert_equal([-1, -1, -1, 4, 4, -1, -1],
+ \ map(range(1, 7), 'foldclosed(v:val)'))
+
+ let &foldcolumn = save_foldcolumn
+ let &ttymouse = save_ttymouse
+ let &term = save_term
+ let &mouse = save_mouse
+ bwipe!
+ endfunc
*** ../vim-8.1.1178/src/version.c 2019-04-17 16:26:57.677439389 +0200
--- src/version.c 2019-04-17 16:30:43.908273796 +0200
***************
*** 773,774 ****
--- 773,776 ----
{ /* Add new patch number below this line */
+ /**/
+ 1179,
/**/
--
The greatest lies of all time:
(1) The check is in the mail.
(2) We have a really challenging assignment for you.
(3) I love you.
(4) All bugs have been fixed.
(5) This won't hurt a bit.
(6) Honey, I just need to debug this program and be home in 5 minutes.
(7) I have just sent you an e-mail about that.
(8) Of course I'll respect you in the morning.
(9) I'm from the government, and I'm here to help you.
/// 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 ///
|