annotate src/testdir/test_termcodes.vim @ 21518:0b448762ebbd v8.2.1309

patch 8.2.1309: build failure with tiny version Commit: https://github.com/vim/vim/commit/461f21242a8fc7f2fe9d1c723741eeda45f0ac72 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jul 28 20:25:47 2020 +0200 patch 8.2.1309: build failure with tiny version Problem: Build failure with tiny version. Solution: Add #ifdef.
author Bram Moolenaar <Bram@vim.org>
date Tue, 28 Jul 2020 20:30:05 +0200
parents e00467b9f5de
children 1d75baa22d9a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16263
d3377393e3d9 patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Tests for decoding escape sequences sent by the terminal.
d3377393e3d9 patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2
d3377393e3d9 patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " This only works for Unix in a terminal
17657
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
4 source check.vim
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
5 CheckNotGui
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
6 CheckUnix
16263
d3377393e3d9 patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7
16437
fbc0b3b38c79 patch 8.1.1223: middle mouse click test fails without a clipboard
Bram Moolenaar <Bram@vim.org>
parents: 16423
diff changeset
8 source shared.vim
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19657
diff changeset
9 source mouse.vim
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
10
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
11 func Test_term_mouse_left_click()
16263
d3377393e3d9 patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 new
d3377393e3d9 patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13 let save_mouse = &mouse
d3377393e3d9 patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 let save_term = &term
d3377393e3d9 patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 let save_ttymouse = &ttymouse
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
16 call test_override('no_query_mouse', 1)
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
17 set mouse=a term=xterm
16263
d3377393e3d9 patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 call setline(1, ['line 1', 'line 2', 'line 3 is a bit longer'])
d3377393e3d9 patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19657
diff changeset
20 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec + g:Ttymouse_netterm
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
21 let msg = 'ttymouse=' .. ttymouse_val
16481
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
22 exe 'set ttymouse=' .. ttymouse_val
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
23 go
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
24 call assert_equal([0, 1, 1, 0], getpos('.'), msg)
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
25 let row = 2
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
26 let col = 6
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
27 call MouseLeftClick(row, col)
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
28 call MouseLeftRelease(row, col)
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
29 call assert_equal([0, 2, 6, 0], getpos('.'), msg)
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
30 endfor
16263
d3377393e3d9 patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31
d3377393e3d9 patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 let &mouse = save_mouse
d3377393e3d9 patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 let &term = save_term
d3377393e3d9 patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 let &ttymouse = save_ttymouse
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
35 call test_override('no_query_mouse', 0)
16263
d3377393e3d9 patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 bwipe!
d3377393e3d9 patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 endfunc
d3377393e3d9 patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38
18307
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
39 func Test_xterm_mouse_right_click_extends_visual()
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
40 if has('mac')
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
41 throw "Skipped: test right click in visual mode does not work on macOs (why?)"
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
42 endif
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
43 let save_mouse = &mouse
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
44 let save_term = &term
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
45 let save_ttymouse = &ttymouse
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
46 call test_override('no_query_mouse', 1)
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
47 set mouse=a term=xterm
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
48
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
49 for visual_mode in ["v", "V", "\<C-V>"]
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19657
diff changeset
50 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
18307
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
51 let msg = 'visual=' .. visual_mode .. ' ttymouse=' .. ttymouse_val
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
52 exe 'set ttymouse=' .. ttymouse_val
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
53
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
54 call setline(1, repeat([repeat('-', 7)], 7))
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
55 call MouseLeftClick(4, 4)
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
56 call MouseLeftRelease(4, 4)
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
57 exe "norm! " .. visual_mode
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
58
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
59 " Right click extends top left of visual area.
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
60 call MouseRightClick(2, 2)
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
61 call MouseRightRelease(2, 2)
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
62
18918
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
63 " Right click extends bottom right of visual area.
18307
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
64 call MouseRightClick(6, 6)
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
65 call MouseRightRelease(6, 6)
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
66 norm! r1gv
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
67
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
68 " Right click shrinks top left of visual area.
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
69 call MouseRightClick(3, 3)
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
70 call MouseRightRelease(3, 3)
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
71
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
72 " Right click shrinks bottom right of visual area.
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
73 call MouseRightClick(5, 5)
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
74 call MouseRightRelease(5, 5)
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
75 norm! r2
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
76
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
77 if visual_mode ==# 'v'
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
78 call assert_equal(['-------',
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
79 \ '-111111',
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
80 \ '1122222',
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
81 \ '2222222',
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
82 \ '2222211',
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
83 \ '111111-',
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
84 \ '-------'], getline(1, '$'), msg)
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
85 elseif visual_mode ==# 'V'
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
86 call assert_equal(['-------',
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
87 \ '1111111',
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
88 \ '2222222',
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
89 \ '2222222',
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
90 \ '2222222',
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
91 \ '1111111',
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
92 \ '-------'], getline(1, '$'), msg)
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
93 else
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
94 call assert_equal(['-------',
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
95 \ '-11111-',
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
96 \ '-12221-',
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
97 \ '-12221-',
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
98 \ '-12221-',
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
99 \ '-11111-',
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
100 \ '-------'], getline(1, '$'), msg)
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
101 endif
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
102 endfor
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
103 endfor
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
104
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
105 let &mouse = save_mouse
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
106 let &term = save_term
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
107 let &ttymouse = save_ttymouse
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
108 call test_override('no_query_mouse', 0)
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
109 bwipe!
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
110 endfunc
176fa195b95d patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents: 18301
diff changeset
111
16481
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
112 " Test that <C-LeftMouse> jumps to help tag and <C-RightMouse> jumps back.
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
113 " Also test for g<LeftMouse> and g<RightMouse>.
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
114 func Test_xterm_mouse_tagjump()
16481
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
115 let save_mouse = &mouse
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
116 let save_term = &term
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
117 let save_ttymouse = &ttymouse
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
118 set mouse=a term=xterm
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
119
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19657
diff changeset
120 for ttymouse_val in g:Ttymouse_values
16481
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
121 let msg = 'ttymouse=' .. ttymouse_val
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
122 exe 'set ttymouse=' .. ttymouse_val
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
123 help
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
124 /usr_02.txt
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
125 norm! zt
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
126
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
127 " CTRL-left click to jump to a tag
16481
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
128 let row = 1
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
129 let col = 1
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
130 call MouseCtrlLeftClick(row, col)
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
131 call MouseLeftRelease(row, col)
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
132 call assert_match('usr_02.txt$', bufname('%'), msg)
18223
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
133 call assert_equal('*usr_02.txt*', expand('<cWORD>'), msg)
16481
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
134
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
135 " CTRL-right click to pop a tag
16481
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
136 call MouseCtrlRightClick(row, col)
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
137 call MouseRightRelease(row, col)
16481
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
138 call assert_match('help.txt$', bufname('%'), msg)
18223
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
139 call assert_equal('|usr_02.txt|', expand('<cWORD>'), msg)
16481
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
140
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
141 " Jump to a tag
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
142 exe "normal \<C-]>"
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
143 call assert_match('usr_02.txt$', bufname('%'), msg)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
144 call assert_equal('*usr_02.txt*', expand('<cWORD>'), msg)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
145
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
146 " Use CTRL-right click in insert mode to pop the tag
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
147 new
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
148 let str = 'iHello' .. MouseCtrlRightClickCode(row, col)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
149 \ .. MouseRightReleaseCode(row, col) .. "\<C-C>"
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
150 call assert_fails('call feedkeys(str, "Lx!")', 'E37:', msg)
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
151 close!
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
152
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
153 " CTRL-right click with a count
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
154 let str = "4" .. MouseCtrlRightClickCode(row, col)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
155 \ .. MouseRightReleaseCode(row, col)
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
156 call assert_fails('call feedkeys(str, "Lx!")', 'E555:', msg)
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
157 call assert_match('help.txt$', bufname('%'), msg)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
158 call assert_equal(1, line('.'), msg)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
159
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
160 " g<LeftMouse> to jump to a tag
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
161 /usr_02.txt
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
162 norm! zt
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
163 call test_setmouse(row, col)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
164 exe "normal g\<LeftMouse>"
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
165 call assert_match('usr_02.txt$', bufname('%'), msg)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
166 call assert_equal('*usr_02.txt*', expand('<cWORD>'), msg)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
167
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
168 " g<RightMouse> to pop to a tag
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
169 call test_setmouse(row, col)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
170 exe "normal g\<RightMouse>"
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
171 call assert_match('help.txt$', bufname('%'), msg)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
172 call assert_equal('|usr_02.txt|', expand('<cWORD>'), msg)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
173
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
174 %bw!
16481
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
175 endfor
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
176
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
177 let &mouse = save_mouse
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
178 let &term = save_term
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
179 let &ttymouse = save_ttymouse
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
180 endfunc
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
181
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
182 func Test_term_mouse_middle_click()
17686
853afcc375b2 patch 8.1.1840: Testing: WorkingClipboard() is not accurate
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
183 CheckFeature clipboard_working
16437
fbc0b3b38c79 patch 8.1.1223: middle mouse click test fails without a clipboard
Bram Moolenaar <Bram@vim.org>
parents: 16423
diff changeset
184
16423
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
185 new
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
186 let save_mouse = &mouse
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
187 let save_term = &term
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
188 let save_ttymouse = &ttymouse
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
189 call test_override('no_query_mouse', 1)
16423
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
190 let save_quotestar = @*
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
191 let save_quoteplus = @+
16423
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
192 set mouse=a term=xterm
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
193
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19657
diff changeset
194 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
16423
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
195 let msg = 'ttymouse=' .. ttymouse_val
16481
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
196 exe 'set ttymouse=' .. ttymouse_val
16423
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
197 call setline(1, ['123456789', '123456789'])
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
198 let @* = 'abc'
16423
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
199
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
200 " Middle-click in the middle of the line pastes text where clicked.
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
201 let row = 1
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
202 let col = 6
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
203 call MouseMiddleClick(row, col)
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
204 call MouseMiddleRelease(row, col)
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
205 call assert_equal(['12345abc6789', '123456789'], getline(1, '$'), msg)
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
206
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
207 " Middle-click beyond end of the line pastes text at the end of the line.
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
208 let col = 20
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
209 call MouseMiddleClick(row, col)
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
210 call MouseMiddleRelease(row, col)
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
211 call assert_equal(['12345abc6789abc', '123456789'], getline(1, '$'), msg)
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
212
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
213 " Middle-click beyond the last line pastes in the last line.
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
214 let row = 5
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
215 let col = 3
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
216 call MouseMiddleClick(row, col)
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
217 call MouseMiddleRelease(row, col)
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
218 call assert_equal(['12345abc6789abc', '12abc3456789'], getline(1, '$'), msg)
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
219
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
220 " Middle mouse click in operator pending mode beeps
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
221 call assert_beeps('exe "normal c\<MiddleMouse>"')
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
222
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
223 " Clicking middle mouse in visual mode, yanks the selection and pastes the
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
224 " clipboard contents
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
225 let save_clipboard = &clipboard
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
226 set clipboard=
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
227 let @" = ''
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
228 call cursor(1, 1)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
229 call feedkeys("v3l" ..
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
230 \ MouseMiddleClickCode(2, 7) .. MouseMiddleReleaseCode(2, 7), 'Lx!')
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
231 call assert_equal(['12345abc6789abc', '12abc3abc456789'],
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
232 \ getline(1, '$'), msg)
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
233 call assert_equal('1234', @", msg)
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
234 let &clipboard = save_clipboard
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
235
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
236 " Clicking middle mouse in select mode, replaces the selected text with
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
237 " the clipboard contents
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
238 let @+ = 'xyz'
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
239 call cursor(1, 3)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
240 exe "normal gh\<Right>\<Right>\<MiddleMouse>"
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
241 call assert_equal(['12xyzabc6789abc', '12abc3abc456789'],
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
242 \ getline(1, '$'), msg)
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
243
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
244 " Prefixing middle click with [ or ] fixes the indent after pasting.
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
245 %d
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
246 call setline(1, " one two")
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
247 call setreg('r', 'red blue', 'l')
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
248 call test_setmouse(1, 5)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
249 exe "normal \"r[\<MiddleMouse>"
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
250 call assert_equal(' red blue', getline(1), msg)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
251 call test_setmouse(2, 5)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
252 exe "normal \"r]\<MiddleMouse>"
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
253 call assert_equal(' red blue', getline(3), msg)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
254 %d
16423
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
255 endfor
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
256
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
257 let &mouse = save_mouse
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
258 let &term = save_term
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
259 let &ttymouse = save_ttymouse
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
260 call test_override('no_query_mouse', 0)
16423
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
261 let @* = save_quotestar
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
262 let @+ = save_quotestar
16423
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
263 bwipe!
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
264 endfunc
4182fa3b9f70 patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16352
diff changeset
265
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
266 " If clipboard is not working, then clicking the middle mouse button in visual
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
267 " mode, will copy and paste the selected text.
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
268 func Test_term_mouse_middle_click_no_clipboard()
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
269 if has('clipboard_working')
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
270 throw 'Skipped: clipboard support works'
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
271 return
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
272 endif
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
273 new
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
274 let save_mouse = &mouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
275 let save_term = &term
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
276 let save_ttymouse = &ttymouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
277 call test_override('no_query_mouse', 1)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
278 set mouse=a term=xterm
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
279
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
280 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
281 let msg = 'ttymouse=' .. ttymouse_val
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
282 exe 'set ttymouse=' .. ttymouse_val
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
283 call setline(1, ['123456789', '123456789'])
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
284
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
285 " Clicking middle mouse in visual mode, yanks the selection and pastes it
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
286 call cursor(1, 1)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
287 call feedkeys("v3l" ..
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
288 \ MouseMiddleClickCode(2, 7) .. MouseMiddleReleaseCode(2, 7), 'Lx!')
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
289 call assert_equal(['123456789', '1234561234789'],
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
290 \ getline(1, '$'), msg)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
291 endfor
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
292
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
293 call test_override('no_query_mouse', 0)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
294 let &ttymouse = save_ttymouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
295 let &term = save_term
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
296 let &mouse = save_mouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
297 close!
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
298 endfunc
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
299
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
300 func Test_term_mouse_middle_click_insert_mode()
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
301 CheckFeature clipboard_working
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
302
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
303 new
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
304 let save_mouse = &mouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
305 let save_term = &term
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
306 let save_ttymouse = &ttymouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
307 call test_override('no_query_mouse', 1)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
308 set mouse=a term=xterm
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
309
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
310 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
311 let msg = 'ttymouse=' .. ttymouse_val
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
312 exe 'set ttymouse=' .. ttymouse_val
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
313 call setline(1, ['123456789', '123456789'])
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
314 let @* = 'abc'
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
315
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
316 " Middle-click in inesrt mode doesn't move the cursor but inserts the
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
317 " contents of aregister
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
318 call cursor(1, 4)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
319 call feedkeys('i' ..
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
320 \ MouseMiddleClickCode(2, 7) .. MouseMiddleReleaseCode(2, 7) ..
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
321 \ "\<C-C>", 'Lx!')
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
322 call assert_equal(['123abc456789', '123456789'],
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
323 \ getline(1, '$'), msg)
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
324 call assert_equal([1, 6], [line('.'), col('.')], msg)
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
326 " Middle-click in replace mode
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
327 call cursor(1, 1)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
328 call feedkeys('$R' ..
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
329 \ MouseMiddleClickCode(2, 7) .. MouseMiddleReleaseCode(2, 7) ..
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
330 \ "\<C-C>", 'Lx!')
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
331 call assert_equal(['123abc45678abc', '123456789'],
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
332 \ getline(1, '$'), msg)
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
333 call assert_equal([1, 14], [line('.'), col('.')], msg)
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
334 endfor
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
335
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
336 let &mouse = save_mouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
337 let &term = save_term
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
338 let &ttymouse = save_ttymouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
339 call test_override('no_query_mouse', 0)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
340 close!
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
341 endfunc
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
342
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
343 " Test for switching window using mouse in insert mode
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
344 func Test_term_mouse_switch_win_insert_mode()
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
345 5new
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
346 let save_mouse = &mouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
347 let save_term = &term
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
348 let save_ttymouse = &ttymouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
349 call test_override('no_query_mouse', 1)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
350 set mouse=a term=xterm ttymouse=xterm2
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
351
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
352 call feedkeys('ivim' ..
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
353 \ MouseLeftClickCode(8, 6) .. MouseLeftReleaseCode(8, 6) ..
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
354 \ "\<C-C>", 'Lx!')
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
355 call assert_equal(2, winnr())
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
356 wincmd w
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
357 call assert_equal('n', mode())
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
358 call assert_equal(['vim'], getline(1, '$'))
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
359
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
360 let &mouse = save_mouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
361 let &term = save_term
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
362 let &ttymouse = save_ttymouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
363 call test_override('no_query_mouse', 0)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
364 close!
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
365 endfunc
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
366
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
367 " Test for using the mouse to increaes the height of the cmdline window
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
368 func Test_mouse_cmdwin_resize()
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
369 let save_mouse = &mouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
370 let save_term = &term
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
371 let save_ttymouse = &ttymouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
372 call test_override('no_query_mouse', 1)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
373 set mouse=a term=xterm ttymouse=xterm2
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
374 5new
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
375 redraw!
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
376
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
377 let h = 0
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
378 let row = &lines - &cmdwinheight - 2
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
379 call feedkeys("q:" ..
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
380 \ MouseLeftClickCode(row, 1) ..
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
381 \ MouseLeftDragCode(row - 1, 1) ..
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
382 \ MouseLeftReleaseCode(row - 2, 1) ..
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
383 \ "alet h = \<C-R>=winheight(0)\<CR>\<CR>", 'Lx!')
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
384 call assert_equal(&cmdwinheight + 2, h)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
385
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
386 let &mouse = save_mouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
387 let &term = save_term
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
388 let &ttymouse = save_ttymouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
389 call test_override('no_query_mouse', 0)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
390 close!
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
391 endfunc
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
392
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
393 " TODO: for unclear reasons this test fails if it comes after
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
394 " Test_xterm_mouse_ctrl_click()
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
395 func Test_1xterm_mouse_wheel()
16265
7feb5b90be5f patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16263
diff changeset
396 new
7feb5b90be5f patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16263
diff changeset
397 let save_mouse = &mouse
7feb5b90be5f patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16263
diff changeset
398 let save_term = &term
21114
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
399 let save_wrap = &wrap
16265
7feb5b90be5f patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16263
diff changeset
400 let save_ttymouse = &ttymouse
21114
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
401 set mouse=a term=xterm nowrap
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
402 call setline(1, range(100000000000000, 100000000000100))
16265
7feb5b90be5f patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16263
diff changeset
403
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19657
diff changeset
404 for ttymouse_val in g:Ttymouse_values
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
405 let msg = 'ttymouse=' .. ttymouse_val
16481
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
406 exe 'set ttymouse=' .. ttymouse_val
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
407 go
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
408 call assert_equal(1, line('w0'), msg)
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
409 call assert_equal([0, 1, 1, 0], getpos('.'), msg)
16265
7feb5b90be5f patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16263
diff changeset
410
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
411 call MouseWheelDown(1, 1)
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
412 call assert_equal(4, line('w0'), msg)
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
413 call assert_equal([0, 4, 1, 0], getpos('.'), msg)
16265
7feb5b90be5f patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16263
diff changeset
414
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
415 call MouseWheelDown(1, 1)
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
416 call assert_equal(7, line('w0'), msg)
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
417 call assert_equal([0, 7, 1, 0], getpos('.'), msg)
16265
7feb5b90be5f patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16263
diff changeset
418
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
419 call MouseWheelUp(1, 1)
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
420 call assert_equal(4, line('w0'), msg)
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
421 call assert_equal([0, 7, 1, 0], getpos('.'), msg)
16265
7feb5b90be5f patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16263
diff changeset
422
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
423 call MouseWheelUp(1, 1)
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
424 call assert_equal(1, line('w0'), msg)
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
425 call assert_equal([0, 7, 1, 0], getpos('.'), msg)
21114
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
426
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
427 if has('gui')
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
428 " Horizontal wheel scrolling currently only works when vim is
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
429 " compiled with gui enabled.
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
430 call MouseWheelRight(1, 1)
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
431 call assert_equal(7, 1 + virtcol(".") - wincol(), msg)
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
432 call assert_equal([0, 7, 7, 0], getpos('.'), msg)
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
433
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
434 call MouseWheelRight(1, 1)
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
435 call assert_equal(13, 1 + virtcol(".") - wincol(), msg)
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
436 call assert_equal([0, 7, 13, 0], getpos('.'), msg)
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
437
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
438 call MouseWheelLeft(1, 1)
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
439 call assert_equal(7, 1 + virtcol(".") - wincol(), msg)
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
440 call assert_equal([0, 7, 13, 0], getpos('.'), msg)
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
441
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
442 call MouseWheelLeft(1, 1)
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
443 call assert_equal(1, 1 + virtcol(".") - wincol(), msg)
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
444 call assert_equal([0, 7, 13, 0], getpos('.'), msg)
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
445 endif
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
446 endfor
16265
7feb5b90be5f patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16263
diff changeset
447
7feb5b90be5f patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16263
diff changeset
448 let &mouse = save_mouse
7feb5b90be5f patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16263
diff changeset
449 let &term = save_term
21114
d0265fdadec9 patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents: 20850
diff changeset
450 let &wrap = save_wrap
16265
7feb5b90be5f patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16263
diff changeset
451 let &ttymouse = save_ttymouse
7feb5b90be5f patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16263
diff changeset
452 bwipe!
7feb5b90be5f patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16263
diff changeset
453 endfunc
16275
ed5172ae1c32 patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents: 16265
diff changeset
454
18223
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
455 " Test that dragging beyond the window (at the bottom and at the top)
18918
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
456 " scrolls window content by the number of lines beyond the window.
18223
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
457 func Test_term_mouse_drag_beyond_window()
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
458 let save_mouse = &mouse
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
459 let save_term = &term
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
460 let save_ttymouse = &ttymouse
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
461 call test_override('no_query_mouse', 1)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
462 set mouse=a term=xterm
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
463 let col = 1
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
464 call setline(1, range(1, 100))
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
465
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
466 " Split into 3 windows, and go into the middle window
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
467 " so we test dragging mouse below and above the window.
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
468 2split
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
469 wincmd j
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
470 2split
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
471
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19657
diff changeset
472 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
18223
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
473 let msg = 'ttymouse=' .. ttymouse_val
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
474 exe 'set ttymouse=' .. ttymouse_val
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
475
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
476 " Line #10 at the top.
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
477 norm! 10zt
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
478 redraw
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
479 call assert_equal(10, winsaveview().topline, msg)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
480 call assert_equal(2, winheight(0), msg)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
481
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
482 let row = 4
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
483 call MouseLeftClick(row, col)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
484 call assert_equal(10, winsaveview().topline, msg)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
485
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
486 " Drag downwards. We're still in the window so topline should
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
487 " not change yet.
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
488 let row += 1
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
489 call MouseLeftDrag(row, col)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
490 call assert_equal(10, winsaveview().topline, msg)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
491
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
492 " We now leave the window at the bottom, so the window content should
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
493 " scroll by 1 line, then 2 lines (etc) as we drag further away.
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
494 let row += 1
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
495 call MouseLeftDrag(row, col)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
496 call assert_equal(11, winsaveview().topline, msg)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
497
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
498 let row += 1
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
499 call MouseLeftDrag(row, col)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
500 call assert_equal(13, winsaveview().topline, msg)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
501
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
502 " Now drag upwards.
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
503 let row -= 1
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
504 call MouseLeftDrag(row, col)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
505 call assert_equal(14, winsaveview().topline, msg)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
506
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
507 " We're now back in the window so the topline should not change.
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
508 let row -= 1
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
509 call MouseLeftDrag(row, col)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
510 call assert_equal(14, winsaveview().topline, msg)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
511
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
512 let row -= 1
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
513 call MouseLeftDrag(row, col)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
514 call assert_equal(14, winsaveview().topline, msg)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
515
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
516 " We now leave the window at the top so the window content should
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
517 " scroll by 1 line, then 2, then 3 (etc) in the opposite direction.
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
518 let row -= 1
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
519 call MouseLeftDrag(row, col)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
520 call assert_equal(13, winsaveview().topline, msg)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
521
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
522 let row -= 1
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
523 call MouseLeftDrag(row, col)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
524 call assert_equal(11, winsaveview().topline, msg)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
525
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
526 let row -= 1
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
527 call MouseLeftDrag(row, col)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
528 call assert_equal(8, winsaveview().topline, msg)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
529
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
530 call MouseLeftRelease(row, col)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
531 call assert_equal(8, winsaveview().topline, msg)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
532 call assert_equal(2, winheight(0), msg)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
533 endfor
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
534
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
535 let &mouse = save_mouse
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
536 let &term = save_term
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
537 let &ttymouse = save_ttymouse
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
538 call test_override('no_query_mouse', 0)
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
539 bwipe!
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
540 endfunc
8a86e518fa42 patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
541
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
542 func Test_term_mouse_drag_window_separator()
16275
ed5172ae1c32 patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents: 16265
diff changeset
543 let save_mouse = &mouse
ed5172ae1c32 patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents: 16265
diff changeset
544 let save_term = &term
ed5172ae1c32 patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents: 16265
diff changeset
545 let save_ttymouse = &ttymouse
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
546 call test_override('no_query_mouse', 1)
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
547 set mouse=a term=xterm
16275
ed5172ae1c32 patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents: 16265
diff changeset
548
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19657
diff changeset
549 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
550 let msg = 'ttymouse=' .. ttymouse_val
16481
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
551 exe 'set ttymouse=' .. ttymouse_val
16275
ed5172ae1c32 patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents: 16265
diff changeset
552
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
553 " Split horizontally and test dragging the horizontal window separator.
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
554 split
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
555 let rowseparator = winheight(0) + 1
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
556 let row = rowseparator
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
557 let col = 1
16310
5b8b849dc3aa patch 8.1.1160: termcodes test would fail in a very big terminal
Bram Moolenaar <Bram@vim.org>
parents: 16300
diff changeset
558
16352
c742c008953e patch 8.1.1181: tests for mouse clicks are a bit flaky
Bram Moolenaar <Bram@vim.org>
parents: 16348
diff changeset
559 " When 'ttymouse' is 'xterm2', row/col bigger than 223 are not supported.
c742c008953e patch 8.1.1181: tests for mouse clicks are a bit flaky
Bram Moolenaar <Bram@vim.org>
parents: 16348
diff changeset
560 if ttymouse_val !=# 'xterm2' || row <= 223
16324
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
561 call MouseLeftClick(row, col)
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
562 let row -= 1
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
563 call MouseLeftDrag(row, col)
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
564 call assert_equal(rowseparator - 1, winheight(0) + 1, msg)
16324
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
565 let row += 1
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
566 call MouseLeftDrag(row, col)
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
567 call assert_equal(rowseparator, winheight(0) + 1, msg)
16324
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
568 call MouseLeftRelease(row, col)
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
569 call assert_equal(rowseparator, winheight(0) + 1, msg)
16310
5b8b849dc3aa patch 8.1.1160: termcodes test would fail in a very big terminal
Bram Moolenaar <Bram@vim.org>
parents: 16300
diff changeset
570 endif
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
571 bwipe!
16275
ed5172ae1c32 patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents: 16265
diff changeset
572
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
573 " Split vertically and test dragging the vertical window separator.
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
574 vsplit
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
575 let colseparator = winwidth(0) + 1
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
576 let row = 1
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
577 let col = colseparator
16275
ed5172ae1c32 patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents: 16265
diff changeset
578
16352
c742c008953e patch 8.1.1181: tests for mouse clicks are a bit flaky
Bram Moolenaar <Bram@vim.org>
parents: 16348
diff changeset
579 " When 'ttymouse' is 'xterm2', row/col bigger than 223 are not supported.
c742c008953e patch 8.1.1181: tests for mouse clicks are a bit flaky
Bram Moolenaar <Bram@vim.org>
parents: 16348
diff changeset
580 if ttymouse_val !=# 'xterm2' || col <= 223
16324
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
581 call MouseLeftClick(row, col)
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
582 let col -= 1
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
583 call MouseLeftDrag(row, col)
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
584 call assert_equal(colseparator - 1, winwidth(0) + 1, msg)
16324
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
585 let col += 1
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
586 call MouseLeftDrag(row, col)
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
587 call assert_equal(colseparator, winwidth(0) + 1, msg)
16324
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
588 call MouseLeftRelease(row, col)
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
589 call assert_equal(colseparator, winwidth(0) + 1, msg)
16324
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
590 endif
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
591 bwipe!
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
592 endfor
16275
ed5172ae1c32 patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents: 16265
diff changeset
593
ed5172ae1c32 patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents: 16265
diff changeset
594 let &mouse = save_mouse
ed5172ae1c32 patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents: 16265
diff changeset
595 let &term = save_term
ed5172ae1c32 patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents: 16265
diff changeset
596 let &ttymouse = save_ttymouse
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
597 call test_override('no_query_mouse', 0)
16275
ed5172ae1c32 patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents: 16265
diff changeset
598 endfunc
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
599
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
600 func Test_term_mouse_drag_statusline()
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
601 let save_mouse = &mouse
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
602 let save_term = &term
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
603 let save_ttymouse = &ttymouse
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
604 call test_override('no_query_mouse', 1)
16320
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
605 let save_laststatus = &laststatus
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
606 set mouse=a term=xterm laststatus=2
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
607
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19657
diff changeset
608 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
609 let msg = 'ttymouse=' .. ttymouse_val
16481
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
610 exe 'set ttymouse=' .. ttymouse_val
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
611
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
612 call assert_equal(1, &cmdheight, msg)
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
613 let rowstatusline = winheight(0) + 1
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
614 let row = rowstatusline
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
615 let col = 1
16310
5b8b849dc3aa patch 8.1.1160: termcodes test would fail in a very big terminal
Bram Moolenaar <Bram@vim.org>
parents: 16300
diff changeset
616
16352
c742c008953e patch 8.1.1181: tests for mouse clicks are a bit flaky
Bram Moolenaar <Bram@vim.org>
parents: 16348
diff changeset
617 if ttymouse_val ==# 'xterm2' && row > 223
c742c008953e patch 8.1.1181: tests for mouse clicks are a bit flaky
Bram Moolenaar <Bram@vim.org>
parents: 16348
diff changeset
618 " When 'ttymouse' is 'xterm2', row/col bigger than 223 are not supported.
16310
5b8b849dc3aa patch 8.1.1160: termcodes test would fail in a very big terminal
Bram Moolenaar <Bram@vim.org>
parents: 16300
diff changeset
619 continue
5b8b849dc3aa patch 8.1.1160: termcodes test would fail in a very big terminal
Bram Moolenaar <Bram@vim.org>
parents: 16300
diff changeset
620 endif
5b8b849dc3aa patch 8.1.1160: termcodes test would fail in a very big terminal
Bram Moolenaar <Bram@vim.org>
parents: 16300
diff changeset
621
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
622 call MouseLeftClick(row, col)
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
623 let row -= 1
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
624 call MouseLeftDrag(row, col)
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
625 call assert_equal(2, &cmdheight, msg)
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
626 call assert_equal(rowstatusline - 1, winheight(0) + 1, msg)
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
627 let row += 1
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
628 call MouseLeftDrag(row, col)
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
629 call assert_equal(1, &cmdheight, msg)
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
630 call assert_equal(rowstatusline, winheight(0) + 1, msg)
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
631 call MouseLeftRelease(row, col)
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
632 call assert_equal(1, &cmdheight, msg)
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
633 call assert_equal(rowstatusline, winheight(0) + 1, msg)
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
634 endfor
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
635
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
636 let &mouse = save_mouse
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
637 let &term = save_term
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
638 let &ttymouse = save_ttymouse
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
639 call test_override('no_query_mouse', 0)
16320
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
640 let &laststatus = save_laststatus
16300
f3d579f009d1 patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents: 16275
diff changeset
641 endfunc
16320
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
642
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
643 func Test_term_mouse_click_tab()
16320
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
644 let save_mouse = &mouse
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
645 let save_term = &term
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
646 let save_ttymouse = &ttymouse
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
647 call test_override('no_query_mouse', 1)
16320
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
648 set mouse=a term=xterm
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
649 let row = 1
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
650
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19657
diff changeset
651 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec + g:Ttymouse_netterm
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
652 let msg = 'ttymouse=' .. ttymouse_val
16481
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
653 exe 'set ttymouse=' .. ttymouse_val
16320
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
654 e Xfoo
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
655 tabnew Xbar
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
656
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
657 let a = split(execute(':tabs'), "\n")
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
658 call assert_equal(['Tab page 1',
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
659 \ ' Xfoo',
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
660 \ 'Tab page 2',
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
661 \ '> Xbar'], a, msg)
16320
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
662
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
663 " Test clicking on tab names in the tabline at the top.
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
664 let col = 2
16324
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
665 redraw
16320
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
666 call MouseLeftClick(row, col)
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
667 call MouseLeftRelease(row, col)
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
668 let a = split(execute(':tabs'), "\n")
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
669 call assert_equal(['Tab page 1',
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
670 \ '> Xfoo',
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
671 \ 'Tab page 2',
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
672 \ ' Xbar'], a, msg)
16320
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
673
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
674 let col = 9
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
675 call MouseLeftClick(row, col)
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
676 call MouseLeftRelease(row, col)
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
677 let a = split(execute(':tabs'), "\n")
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
678 call assert_equal(['Tab page 1',
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
679 \ ' Xfoo',
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
680 \ 'Tab page 2',
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
681 \ '> Xbar'], a, msg)
16320
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
682
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
683 %bwipe!
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
684 endfor
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
685
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
686 let &mouse = save_mouse
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
687 let &term = save_term
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
688 let &ttymouse = save_ttymouse
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
689 call test_override('no_query_mouse', 0)
16320
57e0f6b4a87d patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents: 16310
diff changeset
690 endfunc
16324
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
691
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
692 func Test_term_mouse_click_X_to_close_tab()
16324
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
693 let save_mouse = &mouse
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
694 let save_term = &term
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
695 let save_ttymouse = &ttymouse
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
696 call test_override('no_query_mouse', 1)
16324
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
697 set mouse=a term=xterm
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
698 let row = 1
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
699 let col = &columns
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
700
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19657
diff changeset
701 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec + g:Ttymouse_netterm
16352
c742c008953e patch 8.1.1181: tests for mouse clicks are a bit flaky
Bram Moolenaar <Bram@vim.org>
parents: 16348
diff changeset
702 if ttymouse_val ==# 'xterm2' && col > 223
c742c008953e patch 8.1.1181: tests for mouse clicks are a bit flaky
Bram Moolenaar <Bram@vim.org>
parents: 16348
diff changeset
703 " When 'ttymouse' is 'xterm2', row/col bigger than 223 are not supported.
16324
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
704 continue
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
705 endif
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
706 let msg = 'ttymouse=' .. ttymouse_val
16481
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
707 exe 'set ttymouse=' .. ttymouse_val
16324
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
708 e Xtab1
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
709 tabnew Xtab2
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
710 tabnew Xtab3
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
711 tabn 2
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
712
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
713 let a = split(execute(':tabs'), "\n")
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
714 call assert_equal(['Tab page 1',
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
715 \ ' Xtab1',
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
716 \ 'Tab page 2',
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
717 \ '> Xtab2',
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
718 \ 'Tab page 3',
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
719 \ ' Xtab3'], a, msg)
16324
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
720
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
721 " Click on "X" in tabline to close current tab i.e. Xtab2.
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
722 redraw
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
723 call MouseLeftClick(row, col)
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
724 call MouseLeftRelease(row, col)
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
725 let a = split(execute(':tabs'), "\n")
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
726 call assert_equal(['Tab page 1',
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
727 \ ' Xtab1',
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
728 \ 'Tab page 2',
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
729 \ '> Xtab3'], a, msg)
16324
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
730
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
731 %bwipe!
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
732 endfor
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
733
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
734 let &mouse = save_mouse
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
735 let &term = save_term
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
736 let &ttymouse = save_ttymouse
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
737 call test_override('no_query_mouse', 0)
16324
6b2412d0509f patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents: 16320
diff changeset
738 endfunc
16340
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
739
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
740 func Test_term_mouse_drag_to_move_tab()
16340
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
741 let save_mouse = &mouse
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
742 let save_term = &term
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
743 let save_ttymouse = &ttymouse
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
744 call test_override('no_query_mouse', 1)
16340
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
745 " Set 'mousetime' to 1 to avoid recognizing a double-click in the loop
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
746 set mouse=a term=xterm mousetime=1
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
747 let row = 1
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
748
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19657
diff changeset
749 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
750 let msg = 'ttymouse=' .. ttymouse_val
16481
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
751 exe 'set ttymouse=' .. ttymouse_val
16340
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
752 e Xtab1
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
753 tabnew Xtab2
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
754
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
755 let a = split(execute(':tabs'), "\n")
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
756 call assert_equal(['Tab page 1',
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
757 \ ' Xtab1',
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
758 \ 'Tab page 2',
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
759 \ '> Xtab2'], a, msg)
16340
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
760 redraw
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
761
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
762 " Click in tab2 and drag it to tab1.
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
763 " Check getcharmod() to verify that click is not
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
764 " interpreted as a spurious double-click.
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
765 call MouseLeftClick(row, 10)
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
766 call assert_equal(0, getcharmod(), msg)
16340
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
767 for col in [9, 8, 7, 6]
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
768 call MouseLeftDrag(row, col)
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
769 endfor
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
770 call MouseLeftRelease(row, col)
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
771 let a = split(execute(':tabs'), "\n")
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
772 call assert_equal(['Tab page 1',
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
773 \ '> Xtab2',
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
774 \ 'Tab page 2',
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
775 \ ' Xtab1'], a, msg)
16340
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
776
18627
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
777 " Click elsewhere so that click in next iteration is not
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
778 " interpreted as unwanted double-click.
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
779 call MouseLeftClick(row, 11)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
780 call MouseLeftRelease(row, 11)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
781
16340
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
782 %bwipe!
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
783 endfor
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
784
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
785 let &mouse = save_mouse
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
786 let &term = save_term
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
787 let &ttymouse = save_ttymouse
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
788 call test_override('no_query_mouse', 0)
16340
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
789 set mousetime&
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
790 endfunc
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
791
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
792 func Test_term_mouse_double_click_to_create_tab()
16340
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
793 let save_mouse = &mouse
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
794 let save_term = &term
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
795 let save_ttymouse = &ttymouse
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
796 call test_override('no_query_mouse', 1)
16340
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
797 " Set 'mousetime' to a small value, so that double-click works but we don't
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
798 " have to wait long to avoid a triple-click.
18627
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
799 set mouse=a term=xterm mousetime=200
16340
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
800 let row = 1
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
801 let col = 10
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
802
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19657
diff changeset
803 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
804 let msg = 'ttymouse=' .. ttymouse_val
16481
8428e0edba1b patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents: 16437
diff changeset
805 exe 'set ttymouse=' .. ttymouse_val
16340
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
806 e Xtab1
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
807 tabnew Xtab2
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
808
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
809 let a = split(execute(':tabs'), "\n")
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
810 call assert_equal(['Tab page 1',
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
811 \ ' Xtab1',
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
812 \ 'Tab page 2',
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
813 \ '> Xtab2'], a, msg)
16340
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
814
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
815 redraw
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
816 call MouseLeftClick(row, col)
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
817 " Check getcharmod() to verify that first click is not
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
818 " interpreted as a spurious double-click.
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
819 call assert_equal(0, getcharmod(), msg)
16340
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
820 call MouseLeftRelease(row, col)
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
821 call MouseLeftClick(row, col)
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
822 call assert_equal(32, getcharmod(), msg) " double-click
16340
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
823 call MouseLeftRelease(row, col)
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
824 let a = split(execute(':tabs'), "\n")
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
825 call assert_equal(['Tab page 1',
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
826 \ ' Xtab1',
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
827 \ 'Tab page 2',
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
828 \ '> [No Name]',
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
829 \ 'Tab page 3',
16346
2fb516abde42 patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents: 16342
diff changeset
830 \ ' Xtab2'], a, msg)
16340
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
831
18627
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
832 " Click elsewhere so that click in next iteration is not
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
833 " interpreted as unwanted double click.
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
834 call MouseLeftClick(row, col + 1)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
835 call MouseLeftRelease(row, col + 1)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
836
16340
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
837 %bwipe!
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
838 endfor
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
839
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
840 let &mouse = save_mouse
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
841 let &term = save_term
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
842 let &ttymouse = save_ttymouse
16489
42910f306377 patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents: 16487
diff changeset
843 call test_override('no_query_mouse', 0)
16340
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
844 set mousetime&
2f70fc41ff7e patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents: 16324
diff changeset
845 endfunc
16348
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
846
18627
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
847 " Test double/triple/quadruple click in normal mode to visually select.
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
848 func Test_term_mouse_multiple_clicks_to_visually_select()
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
849 let save_mouse = &mouse
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
850 let save_term = &term
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
851 let save_ttymouse = &ttymouse
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
852 call test_override('no_query_mouse', 1)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
853 set mouse=a term=xterm mousetime=200
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
854 new
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
855
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19657
diff changeset
856 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
18627
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
857 let msg = 'ttymouse=' .. ttymouse_val
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
858 exe 'set ttymouse=' .. ttymouse_val
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
859 call setline(1, ['foo [foo bar] foo', 'foo'])
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
860
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
861 " Double-click on word should visually select the word.
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
862 call MouseLeftClick(1, 2)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
863 call assert_equal(0, getcharmod(), msg)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
864 call MouseLeftRelease(1, 2)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
865 call MouseLeftClick(1, 2)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
866 call assert_equal(32, getcharmod(), msg) " double-click
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
867 call MouseLeftRelease(1, 2)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
868 call assert_equal('v', mode(), msg)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
869 norm! r1
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
870 call assert_equal(['111 [foo bar] foo', 'foo'], getline(1, '$'), msg)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
871
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
872 " Double-click on opening square bracket should visually
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
873 " select the whole [foo bar].
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
874 call MouseLeftClick(1, 5)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
875 call assert_equal(0, getcharmod(), msg)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
876 call MouseLeftRelease(1, 5)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
877 call MouseLeftClick(1, 5)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
878 call assert_equal(32, getcharmod(), msg) " double-click
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
879 call MouseLeftRelease(1, 5)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
880 call assert_equal('v', mode(), msg)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
881 norm! r2
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
882 call assert_equal(['111 222222222 foo', 'foo'], getline(1, '$'), msg)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
883
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
884 " Triple-click should visually select the whole line.
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
885 call MouseLeftClick(1, 3)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
886 call assert_equal(0, getcharmod(), msg)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
887 call MouseLeftRelease(1, 3)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
888 call MouseLeftClick(1, 3)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
889 call assert_equal(32, getcharmod(), msg) " double-click
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
890 call MouseLeftRelease(1, 3)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
891 call MouseLeftClick(1, 3)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
892 call assert_equal(64, getcharmod(), msg) " triple-click
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
893 call MouseLeftRelease(1, 3)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
894 call assert_equal('V', mode(), msg)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
895 norm! r3
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
896 call assert_equal(['33333333333333333', 'foo'], getline(1, '$'), msg)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
897
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
898 " Quadruple-click should start visual block select.
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
899 call MouseLeftClick(1, 2)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
900 call assert_equal(0, getcharmod(), msg)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
901 call MouseLeftRelease(1, 2)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
902 call MouseLeftClick(1, 2)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
903 call assert_equal(32, getcharmod(), msg) " double-click
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
904 call MouseLeftRelease(1, 2)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
905 call MouseLeftClick(1, 2)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
906 call assert_equal(64, getcharmod(), msg) " triple-click
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
907 call MouseLeftRelease(1, 2)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
908 call MouseLeftClick(1, 2)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
909 call assert_equal(96, getcharmod(), msg) " quadruple-click
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
910 call MouseLeftRelease(1, 2)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
911 call assert_equal("\<c-v>", mode(), msg)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
912 norm! r4
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
913 call assert_equal(['34333333333333333', 'foo'], getline(1, '$'), msg)
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
914
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
915 " Double-click on a space character should visually select all the
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
916 " consecutive space characters.
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
917 %d
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
918 call setline(1, ' one two')
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
919 call MouseLeftClick(1, 2)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
920 call MouseLeftRelease(1, 2)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
921 call MouseLeftClick(1, 2)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
922 call MouseLeftRelease(1, 2)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
923 call assert_equal('v', mode(), msg)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
924 norm! r1
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
925 call assert_equal(['1111one two'], getline(1, '$'), msg)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
926
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
927 " Double-click on a word with exclusive selection
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
928 set selection=exclusive
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
929 let @" = ''
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
930 call MouseLeftClick(1, 10)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
931 call MouseLeftRelease(1, 10)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
932 call MouseLeftClick(1, 10)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
933 call MouseLeftRelease(1, 10)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
934 norm! y
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
935 call assert_equal('two', @", msg)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
936
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
937 " Double click to select a block of text with exclusive selection
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
938 %d
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
939 call setline(1, 'one (two) three')
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
940 call MouseLeftClick(1, 5)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
941 call MouseLeftRelease(1, 5)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
942 call MouseLeftClick(1, 5)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
943 call MouseLeftRelease(1, 5)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
944 norm! y
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
945 call assert_equal(5, col("'<"), msg)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
946 call assert_equal(10, col("'>"), msg)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
947
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
948 call MouseLeftClick(1, 9)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
949 call MouseLeftRelease(1, 9)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
950 call MouseLeftClick(1, 9)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
951 call MouseLeftRelease(1, 9)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
952 norm! y
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
953 call assert_equal(5, col("'<"), msg)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
954 call assert_equal(10, col("'>"), msg)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
955 set selection&
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
956
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
957 " Click somewhere else so that the clicks above is not combined with the
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
958 " clicks in the next iteration.
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
959 call MouseRightClick(3, 10)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
960 call MouseRightRelease(3, 10)
18627
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
961 endfor
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
962
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
963 let &mouse = save_mouse
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
964 let &term = save_term
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
965 let &ttymouse = save_ttymouse
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
966 set mousetime&
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
967 call test_override('no_query_mouse', 0)
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
968 bwipe!
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
969 endfunc
169c810d4e51 patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18360
diff changeset
970
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
971 " Test for selecting text in visual blockwise mode using Alt-LeftClick
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
972 func Test_mouse_alt_leftclick()
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
973 let save_mouse = &mouse
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
974 let save_term = &term
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
975 let save_ttymouse = &ttymouse
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
976 call test_override('no_query_mouse', 1)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
977 set mouse=a term=xterm mousetime=200
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
978 set mousemodel=popup
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
979 new
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
980 call setline(1, 'one (two) three')
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
981
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
982 for ttymouse_val in g:Ttymouse_values
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
983 let msg = 'ttymouse=' .. ttymouse_val
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
984 exe 'set ttymouse=' .. ttymouse_val
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
985
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
986 " Left click with the Alt modifier key should extend the selection in
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
987 " blockwise visual mode.
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
988 let @" = ''
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
989 call MouseLeftClick(1, 3)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
990 call MouseLeftRelease(1, 3)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
991 call MouseAltLeftClick(1, 11)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
992 call MouseLeftRelease(1, 11)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
993 call assert_equal("\<C-V>", mode(), msg)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
994 normal! y
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
995 call assert_equal('e (two) t', @")
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
996 endfor
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
997
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
998 let &mouse = save_mouse
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
999 let &term = save_term
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1000 let &ttymouse = save_ttymouse
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1001 set mousetime& mousemodel&
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1002 call test_override('no_query_mouse', 0)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1003 close!
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1004 endfunc
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1005
16348
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1006 func Test_xterm_mouse_click_in_fold_columns()
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1007 new
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1008 let save_mouse = &mouse
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1009 let save_term = &term
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1010 let save_ttymouse = &ttymouse
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1011 let save_foldcolumn = &foldcolumn
16352
c742c008953e patch 8.1.1181: tests for mouse clicks are a bit flaky
Bram Moolenaar <Bram@vim.org>
parents: 16348
diff changeset
1012 set mouse=a term=xterm foldcolumn=3 ttymouse=xterm2
16348
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1013
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1014 " Create 2 nested folds.
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1015 call setline(1, range(1, 7))
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1016 2,6fold
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1017 norm! zR
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1018 4,5fold
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1019 call assert_equal([-1, -1, -1, 4, 4, -1, -1],
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1020 \ map(range(1, 7), 'foldclosed(v:val)'))
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1021
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1022 " Click in "+" of inner fold in foldcolumn should open it.
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1023 redraw
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1024 let row = 4
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1025 let col = 2
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1026 call MouseLeftClick(row, col)
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1027 call MouseLeftRelease(row, col)
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1028 call assert_equal([-1, -1, -1, -1, -1, -1, -1],
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1029 \ map(range(1, 7), 'foldclosed(v:val)'))
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1030
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1031 " Click in "-" of outer fold in foldcolumn should close it.
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1032 redraw
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1033 let row = 2
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1034 let col = 1
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1035 call MouseLeftClick(row, col)
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1036 call MouseLeftRelease(row, col)
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1037 call assert_equal([-1, 2, 2, 2, 2, 2, -1],
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1038 \ map(range(1, 7), 'foldclosed(v:val)'))
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1039 norm! zR
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1040
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1041 " Click in "|" of inner fold in foldcolumn should close it.
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1042 redraw
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1043 let row = 5
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1044 let col = 2
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1045 call MouseLeftClick(row, col)
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1046 call MouseLeftRelease(row, col)
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1047 call assert_equal([-1, -1, -1, 4, 4, -1, -1],
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1048 \ map(range(1, 7), 'foldclosed(v:val)'))
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1049
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1050 let &foldcolumn = save_foldcolumn
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1051 let &ttymouse = save_ttymouse
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1052 let &term = save_term
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1053 let &mouse = save_mouse
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1054 bwipe!
5f3a86ba4261 patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents: 16346
diff changeset
1055 endfunc
16936
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1056
18918
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1057 " Left or right click in Ex command line sets position of the cursor.
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1058 func Test_term_mouse_click_in_cmdline_to_set_pos()
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1059 let save_mouse = &mouse
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1060 let save_term = &term
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1061 let save_ttymouse = &ttymouse
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1062 call test_override('no_query_mouse', 1)
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1063 set mouse=a term=xterm
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1064 let row = &lines
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1065
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19657
diff changeset
1066 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
19752
0927df746554 patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
1067 " When 'ttymouse' is 'xterm2', row/col bigger than 223 are not supported.
0927df746554 patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
1068 if ttymouse_val !=# 'xterm2' || row <= 223
0927df746554 patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
1069 let msg = 'ttymouse=' .. ttymouse_val
0927df746554 patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
1070 exe 'set ttymouse=' .. ttymouse_val
0927df746554 patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
1071
18918
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1072
19752
0927df746554 patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
1073 call feedkeys(':"3456789'
0927df746554 patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
1074 \ .. MouseLeftClickCode(row, 7)
0927df746554 patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
1075 \ .. MouseLeftReleaseCode(row, 7) .. 'L'
0927df746554 patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
1076 \ .. MouseRightClickCode(row, 4)
0927df746554 patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
1077 \ .. MouseRightReleaseCode(row, 4) .. 'R'
0927df746554 patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
1078 \ .. "\<CR>", 'Lx!')
0927df746554 patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
1079 call assert_equal('"3R456L789', @:, msg)
0927df746554 patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
1080 endif
18918
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1081 endfor
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1082
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1083 let &mouse = save_mouse
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1084 let &term = save_term
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1085 let &ttymouse = save_ttymouse
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1086 set mousetime&
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1087 call test_override('no_query_mouse', 0)
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1088 endfunc
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1089
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1090 " Middle click in command line pastes at position of cursor.
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1091 func Test_term_mouse_middle_click_in_cmdline_to_paste()
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1092 CheckFeature clipboard_working
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1093 let save_mouse = &mouse
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1094 let save_term = &term
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1095 let save_ttymouse = &ttymouse
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1096 call test_override('no_query_mouse', 1)
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1097 set mouse=a term=xterm
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1098 let row = &lines
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1099 " Column values does not matter, paste is done at position of cursor.
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1100 let col = 1
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1101 let @* = 'paste'
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1102
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19657
diff changeset
1103 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
18918
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1104 let msg = 'ttymouse=' .. ttymouse_val
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1105 exe 'set ttymouse=' .. ttymouse_val
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1106
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1107 call feedkeys(":\"->"
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1108 \ .. MouseMiddleReleaseCode(row, col)
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1109 \ .. MouseMiddleClickCode(row, col)
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1110 \ .. "<-"
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1111 \ .. MouseMiddleReleaseCode(row, col)
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1112 \ .. MouseMiddleClickCode(row, col)
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1113 \ .. "\<CR>", 'Lx!')
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1114 call assert_equal('"->paste<-paste', @:, msg)
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1115 endfor
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1116
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1117 let &mouse = save_mouse
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1118 let &term = save_term
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1119 let &ttymouse = save_ttymouse
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1120 let @* = ''
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1121 call test_override('no_query_mouse', 0)
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1122 endfunc
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1123
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1124 " Test for making sure S-Middlemouse doesn't do anything
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1125 func Test_term_mouse_shift_middle_click()
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1126 new
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1127 let save_mouse = &mouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1128 let save_term = &term
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1129 let save_ttymouse = &ttymouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1130 call test_override('no_query_mouse', 1)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1131 set mouse=a term=xterm ttymouse=xterm2 mousemodel=
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1132
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1133 call test_setmouse(1, 1)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1134 exe "normal \<S-MiddleMouse>"
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1135 call assert_equal([''], getline(1, '$'))
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1136 call assert_equal(1, winnr())
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1137
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1138 let &mouse = save_mouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1139 let &term = save_term
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1140 let &ttymouse = save_ttymouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1141 set mousemodel&
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1142 call test_override('no_query_mouse', 0)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1143 close!
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1144 endfunc
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1145
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1146 " Test for using mouse in visual mode
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1147 func Test_term_mouse_visual_mode()
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1148 new
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1149 let save_mouse = &mouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1150 let save_term = &term
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1151 let save_ttymouse = &ttymouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1152 call test_override('no_query_mouse', 1)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1153 set term=xterm ttymouse=xterm2
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1154
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1155 " If visual mode is not present in 'mouse', then left click should not
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1156 " do anything in visal mode.
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1157 call setline(1, ['one two three four'])
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1158 set mouse=nci
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1159 call cursor(1, 5)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1160 let @" = ''
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1161 call feedkeys("ve"
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1162 \ .. MouseLeftClickCode(1, 15) .. MouseLeftReleaseCode(1, 15)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1163 \ .. 'y', 'Lx!')
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1164 call assert_equal(5, col('.'))
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1165 call assert_equal('two', @")
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1166
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1167 " Pressing right click in visual mode should change the visual selection
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1168 " if 'mousemodel' doesn't contain popup.
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1169 " Right click after the visual selection
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1170 set mousemodel=
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1171 set mouse=a
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1172 call test_setmouse(1, 13)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1173 exe "normal 5|ve\<RightMouse>y"
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1174 call assert_equal('two three', @")
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1175 call assert_equal(5, col('.'))
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1176
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1177 " Right click before the visual selection
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1178 call test_setmouse(1, 9)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1179 exe "normal 15|ve\<RightMouse>y"
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1180 call assert_equal('three four', @")
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1181 call assert_equal(9, col('.'))
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1182
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1183 " Right click inside the selection closer to the start of the selection
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1184 call test_setmouse(1, 7)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1185 exe "normal 5|vee\<RightMouse>lly"
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1186 call assert_equal('three', @")
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1187 call assert_equal(9, col('.'))
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1188 call assert_equal(9, col("'<"))
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1189 call assert_equal(13, col("'>"))
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1190
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1191 " Right click inside the selection closer to the end of the selection
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1192 call test_setmouse(1, 11)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1193 exe "normal 5|vee\<RightMouse>ly"
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1194 call assert_equal('two thre', @")
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1195 call assert_equal(5, col('.'))
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1196 call assert_equal(5, col("'<"))
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1197 call assert_equal(12, col("'>"))
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1198
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1199 " Multi-line selection. Right click inside thse selection.
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1200 call setline(1, repeat(['aaaaaa'], 7))
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1201 call test_setmouse(3, 1)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1202 exe "normal ggVG\<RightMouse>y"
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1203 call assert_equal(3, line("'<"))
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1204 call test_setmouse(5, 1)
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1205 exe "normal ggVG\<RightMouse>y"
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1206 call assert_equal(5, line("'>"))
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1207
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1208 " Click right in the middle line of the selection
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1209 call test_setmouse(4, 3)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1210 exe "normal ggVG$\<RightMouse>y"
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1211 call assert_equal(4, line("'<"))
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1212 call test_setmouse(4, 4)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1213 exe "normal ggVG$\<RightMouse>y"
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1214 call assert_equal(4, line("'>"))
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1215
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1216 set mousemodel&
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1217 let &mouse = save_mouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1218 let &term = save_term
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1219 let &ttymouse = save_ttymouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1220 call test_override('no_query_mouse', 0)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1221 close!
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1222 endfunc
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1223
19657
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1224 " Test for displaying the popup menu using the right mouse click
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1225 func Test_term_mouse_popup_menu()
19657
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1226 CheckFeature menu
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1227 new
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1228 call setline(1, 'popup menu test')
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1229 let save_mouse = &mouse
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1230 let save_term = &term
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1231 let save_ttymouse = &ttymouse
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1232 let save_mousemodel = &mousemodel
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1233 call test_override('no_query_mouse', 1)
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1234 set mouse=a term=xterm mousemodel=popup
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1235
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1236 menu PopUp.foo :let g:menustr = 'foo'<CR>
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1237 menu PopUp.bar :let g:menustr = 'bar'<CR>
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1238 menu PopUp.baz :let g:menustr = 'baz'<CR>
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1239
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19657
diff changeset
1240 for ttymouse_val in g:Ttymouse_values
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1241 let msg = 'ttymouse=' .. ttymouse_val
19657
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1242 exe 'set ttymouse=' .. ttymouse_val
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1243 let g:menustr = ''
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1244 call feedkeys(MouseRightClickCode(1, 4)
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1245 \ .. MouseRightReleaseCode(1, 4) .. "\<Down>\<Down>\<CR>", "x")
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1246 call assert_equal('bar', g:menustr, msg)
19657
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1247 endfor
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1248
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1249 unmenu PopUp
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1250 let &mouse = save_mouse
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1251 let &term = save_term
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1252 let &ttymouse = save_ttymouse
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1253 let &mousemodel = save_mousemodel
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1254 call test_override('no_query_mouse', 0)
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1255 close!
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1256 endfunc
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
1257
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1258 " Test for 'mousemodel' set to popup_setpos to move the cursor where the popup
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1259 " menu is displayed.
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1260 func Test_term_mouse_popup_menu_setpos()
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1261 CheckFeature menu
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1262 5new
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1263 call setline(1, ['the dish ran away with the spoon',
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1264 \ 'the cow jumped over the moon' ])
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1265 let save_mouse = &mouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1266 let save_term = &term
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1267 let save_ttymouse = &ttymouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1268 let save_mousemodel = &mousemodel
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1269 call test_override('no_query_mouse', 1)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1270 set mouse=a term=xterm mousemodel=popup_setpos
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1271
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1272 nmenu PopUp.foo :let g:menustr = 'foo'<CR>
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1273 nmenu PopUp.bar :let g:menustr = 'bar'<CR>
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1274 nmenu PopUp.baz :let g:menustr = 'baz'<CR>
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1275 vmenu PopUp.foo y:<C-U>let g:menustr = 'foo'<CR>
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1276 vmenu PopUp.bar y:<C-U>let g:menustr = 'bar'<CR>
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1277 vmenu PopUp.baz y:<C-U>let g:menustr = 'baz'<CR>
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1278
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1279 for ttymouse_val in g:Ttymouse_values
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1280 let msg = 'ttymouse=' .. ttymouse_val
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1281 exe 'set ttymouse=' .. ttymouse_val
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1282 let g:menustr = ''
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1283 call cursor(1, 1)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1284 call feedkeys(MouseRightClickCode(1, 5)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1285 \ .. MouseRightReleaseCode(1, 5) .. "\<Down>\<Down>\<CR>", "x")
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1286 call assert_equal('bar', g:menustr, msg)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1287 call assert_equal([1, 5], [line('.'), col('.')], msg)
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1288
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1289 " Test for right click in visual mode inside the selection
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1290 let @" = ''
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1291 call cursor(1, 10)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1292 call feedkeys('vee' .. MouseRightClickCode(1, 12)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1293 \ .. MouseRightReleaseCode(1, 12) .. "\<Down>\<CR>", "x")
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1294 call assert_equal([1, 10], [line('.'), col('.')], msg)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1295 call assert_equal('ran away', @", msg)
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1296
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1297 " Test for right click in visual mode before the selection
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1298 let @" = ''
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1299 call cursor(1, 10)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1300 call feedkeys('vee' .. MouseRightClickCode(1, 2)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1301 \ .. MouseRightReleaseCode(1, 2) .. "\<Down>\<CR>", "x")
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1302 call assert_equal([1, 2], [line('.'), col('.')], msg)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1303 call assert_equal('', @", msg)
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1304
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1305 " Test for right click in visual mode after the selection
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1306 let @" = ''
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1307 call cursor(1, 10)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1308 call feedkeys('vee' .. MouseRightClickCode(1, 20)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1309 \ .. MouseRightReleaseCode(1, 20) .. "\<Down>\<CR>", "x")
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1310 call assert_equal([1, 20], [line('.'), col('.')], msg)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1311 call assert_equal('', @", msg)
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1312
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1313 " Test for right click in block-wise visual mode inside the selection
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1314 let @" = ''
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1315 call cursor(1, 16)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1316 call feedkeys("\<C-V>j3l" .. MouseRightClickCode(2, 17)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1317 \ .. MouseRightReleaseCode(2, 17) .. "\<Down>\<CR>", "x")
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1318 call assert_equal([1, 16], [line('.'), col('.')], msg)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1319 call assert_equal("\<C-V>4", getregtype('"'), msg)
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1320
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1321 " Test for right click in block-wise visual mode outside the selection
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1322 let @" = ''
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1323 call cursor(1, 16)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1324 call feedkeys("\<C-V>j3l" .. MouseRightClickCode(2, 2)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1325 \ .. MouseRightReleaseCode(2, 2) .. "\<Down>\<CR>", "x")
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1326 call assert_equal([2, 2], [line('.'), col('.')], msg)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1327 call assert_equal('v', getregtype('"'), msg)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1328 call assert_equal('', @", msg)
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1329
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1330 " Try clicking on the status line
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1331 let @" = ''
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1332 call cursor(1, 10)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1333 call feedkeys('vee' .. MouseRightClickCode(6, 2)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1334 \ .. MouseRightReleaseCode(6, 2) .. "\<Down>\<CR>", "x")
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1335 call assert_equal([1, 10], [line('.'), col('.')], msg)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1336 call assert_equal('ran away', @", msg)
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1337
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1338 " Try clicking outside the window
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1339 let @" = ''
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1340 call cursor(7, 2)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1341 call feedkeys('vee' .. MouseRightClickCode(7, 2)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1342 \ .. MouseRightReleaseCode(7, 2) .. "\<Down>\<CR>", "x")
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1343 call assert_equal(2, winnr(), msg)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1344 call assert_equal('', @", msg)
21325
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1345 wincmd w
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1346 endfor
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1347
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1348 unmenu PopUp
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1349 let &mouse = save_mouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1350 let &term = save_term
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1351 let &ttymouse = save_ttymouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1352 let &mousemodel = save_mousemodel
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1353 call test_override('no_query_mouse', 0)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1354 close!
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1355 endfunc
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1356
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1357 " Test for searching for the word under the cursor using Shift-Right or
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1358 " Shift-Left click.
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1359 func Test_term_mouse_search()
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1360 new
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1361 let save_mouse = &mouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1362 let save_term = &term
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1363 let save_ttymouse = &ttymouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1364 call test_override('no_query_mouse', 1)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1365 set mouse=a term=xterm ttymouse=xterm2
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1366 set mousemodel=
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1367
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1368 " In normal mode, Shift-Left or Shift-Right click should search for the word
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1369 " under the cursor.
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1370 call setline(1, ['one two three four', 'four three two one'])
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1371 call test_setmouse(1, 4)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1372 exe "normal \<S-LeftMouse>"
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1373 call assert_equal([2, 12], [line('.'), col('.')])
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1374 call test_setmouse(2, 16)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1375 exe "normal \<S-RightMouse>"
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1376 call assert_equal([1, 1], [line('.'), col('.')])
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1377
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1378 " In visual mode, Shift-Left or Shift-Right click should search for the word
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1379 " under the cursor and extend the selection.
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1380 call test_setmouse(1, 4)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1381 exe "normal 4|ve\<S-LeftMouse>y"
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1382 call assert_equal([2, 12], [line("'>"), col("'>")])
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1383 call test_setmouse(2, 16)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1384 exe "normal 2G16|ve\<S-RightMouse>y"
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1385 call assert_equal([1, 1], [line("'<"), col("'<")])
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1386
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1387 set mousemodel&
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1388 let &mouse = save_mouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1389 let &term = save_term
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1390 let &ttymouse = save_ttymouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1391 call test_override('no_query_mouse', 0)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1392 close!
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1393 endfunc
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1394
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1395 " Test for selecting an entry in the quickfix/location list window using the
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1396 " mouse.
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1397 func Test_term_mouse_quickfix_window()
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1398 let save_mouse = &mouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1399 let save_term = &term
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1400 let save_ttymouse = &ttymouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1401 call test_override('no_query_mouse', 1)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1402 set mouse=a term=xterm ttymouse=xterm2
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1403 set mousemodel=
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1404
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1405 cgetexpr "Xfile1:1:L1"
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1406 copen 5
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1407 call test_setmouse(&lines - 7, 1)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1408 exe "normal \<2-LeftMouse>"
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1409 call assert_equal('Xfile1', @%)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1410 %bw!
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1411
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1412 lgetexpr "Xfile2:1:L1"
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1413 lopen 5
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1414 call test_setmouse(&lines - 7, 1)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1415 exe "normal \<2-LeftMouse>"
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1416 call assert_equal('Xfile2', @%)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1417 %bw!
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1418
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1419 set mousemodel&
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1420 let &mouse = save_mouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1421 let &term = save_term
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1422 let &ttymouse = save_ttymouse
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1423 call test_override('no_query_mouse', 0)
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1424 endfunc
f68b121daa47 patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents: 21114
diff changeset
1425
21369
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1426 " Test for the 'h' flag in the 'mouse' option. Using mouse in the help window.
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1427 func Test_term_mouse_help_window()
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1428 let save_mouse = &mouse
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1429 let save_term = &term
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1430 let save_ttymouse = &ttymouse
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1431 call test_override('no_query_mouse', 1)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1432 set mouse=h term=xterm mousetime=200
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1433
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1434 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1435 let msg = 'ttymouse=' .. ttymouse_val
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1436 exe 'set ttymouse=' .. ttymouse_val
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1437 help
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1438 let @" = ''
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1439 call MouseLeftClick(2, 5)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1440 call MouseLeftRelease(2, 5)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1441 call MouseLeftClick(1, 1)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1442 call MouseLeftDrag(1, 10)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1443 call MouseLeftRelease(1, 10)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1444 norm! y
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1445 call assert_equal('*help.txt*', @", msg)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1446 helpclose
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1447
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1448 " Click somewhere else to make sure the left click above is not combined
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1449 " with the next left click and treated as a double click
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1450 call MouseRightClick(5, 10)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1451 call MouseRightRelease(5, 10)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1452 endfor
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1453
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1454 let &mouse = save_mouse
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1455 let &term = save_term
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1456 let &ttymouse = save_ttymouse
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1457 set mousetime&
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1458 call test_override('no_query_mouse', 0)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1459 %bw!
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1460 endfunc
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1461
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1462 " Test for the translation of various mouse terminal codes
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1463 func Test_mouse_termcodes()
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1464 let save_mouse = &mouse
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1465 let save_term = &term
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1466 let save_ttymouse = &ttymouse
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1467 call test_override('no_query_mouse', 1)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1468 set mouse=a term=xterm mousetime=200
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1469
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1470 new
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1471 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec + g:Ttymouse_netterm
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1472 let msg = 'ttymouse=' .. ttymouse_val
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1473 exe 'set ttymouse=' .. ttymouse_val
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1474
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1475 let mouse_codes = [
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1476 \ ["\<LeftMouse>", "<LeftMouse>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1477 \ ["\<MiddleMouse>", "<MiddleMouse>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1478 \ ["\<RightMouse>", "<RightMouse>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1479 \ ["\<S-LeftMouse>", "<S-LeftMouse>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1480 \ ["\<S-MiddleMouse>", "<S-MiddleMouse>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1481 \ ["\<S-RightMouse>", "<S-RightMouse>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1482 \ ["\<C-LeftMouse>", "<C-LeftMouse>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1483 \ ["\<C-MiddleMouse>", "<C-MiddleMouse>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1484 \ ["\<C-RightMouse>", "<C-RightMouse>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1485 \ ["\<M-LeftMouse>", "<M-LeftMouse>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1486 \ ["\<M-MiddleMouse>", "<M-MiddleMouse>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1487 \ ["\<M-RightMouse>", "<M-RightMouse>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1488 \ ["\<2-LeftMouse>", "<2-LeftMouse>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1489 \ ["\<2-MiddleMouse>", "<2-MiddleMouse>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1490 \ ["\<2-RightMouse>", "<2-RightMouse>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1491 \ ["\<3-LeftMouse>", "<3-LeftMouse>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1492 \ ["\<3-MiddleMouse>", "<3-MiddleMouse>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1493 \ ["\<3-RightMouse>", "<3-RightMouse>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1494 \ ["\<4-LeftMouse>", "<4-LeftMouse>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1495 \ ["\<4-MiddleMouse>", "<4-MiddleMouse>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1496 \ ["\<4-RightMouse>", "<4-RightMouse>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1497 \ ["\<LeftDrag>", "<LeftDrag>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1498 \ ["\<MiddleDrag>", "<MiddleDrag>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1499 \ ["\<RightDrag>", "<RightDrag>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1500 \ ["\<LeftRelease>", "<LeftRelease>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1501 \ ["\<MiddleRelease>", "<MiddleRelease>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1502 \ ["\<RightRelease>", "<RightRelease>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1503 \ ["\<ScrollWheelUp>", "<ScrollWheelUp>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1504 \ ["\<S-ScrollWheelUp>", "<S-ScrollWheelUp>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1505 \ ["\<C-ScrollWheelUp>", "<C-ScrollWheelUp>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1506 \ ["\<ScrollWheelDown>", "<ScrollWheelDown>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1507 \ ["\<S-ScrollWheelDown>", "<S-ScrollWheelDown>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1508 \ ["\<C-ScrollWheelDown>", "<C-ScrollWheelDown>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1509 \ ["\<ScrollWheelLeft>", "<ScrollWheelLeft>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1510 \ ["\<S-ScrollWheelLeft>", "<S-ScrollWheelLeft>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1511 \ ["\<C-ScrollWheelLeft>", "<C-ScrollWheelLeft>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1512 \ ["\<ScrollWheelRight>", "<ScrollWheelRight>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1513 \ ["\<S-ScrollWheelRight>", "<S-ScrollWheelRight>"],
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1514 \ ["\<C-ScrollWheelRight>", "<C-ScrollWheelRight>"]
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1515 \ ]
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1516
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1517 for [code, outstr] in mouse_codes
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1518 exe "normal ggC\<C-K>" . code
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1519 call assert_equal(outstr, getline(1), msg)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1520 endfor
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1521 endfor
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1522
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1523 let &mouse = save_mouse
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1524 let &term = save_term
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1525 let &ttymouse = save_ttymouse
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1526 set mousetime&
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1527 call test_override('no_query_mouse', 0)
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1528 %bw!
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1529 endfunc
e00467b9f5de patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21325
diff changeset
1530
16936
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1531 " This only checks if the sequence is recognized.
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1532 func Test_term_rgb_response()
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1533 set t_RF=x
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1534 set t_RB=y
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1535
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1536 " response to t_RF, 4 digits
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1537 let red = 0x12
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1538 let green = 0x34
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1539 let blue = 0x56
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1540 let seq = printf("\<Esc>]10;rgb:%02x00/%02x00/%02x00\x07", red, green, blue)
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1541 call feedkeys(seq, 'Lx!')
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1542 call assert_equal(seq, v:termrfgresp)
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1543
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1544 " response to t_RF, 2 digits
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1545 let red = 0x78
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1546 let green = 0x9a
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1547 let blue = 0xbc
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1548 let seq = printf("\<Esc>]10;rgb:%02x/%02x/%02x\x07", red, green, blue)
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1549 call feedkeys(seq, 'Lx!')
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1550 call assert_equal(seq, v:termrfgresp)
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1551
16940
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1552 " response to t_RB, 4 digits, dark
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1553 set background=light
18031
8a2fb21c23c0 patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17914
diff changeset
1554 eval 'background'->test_option_not_set()
16940
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1555 let red = 0x29
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1556 let green = 0x4a
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1557 let blue = 0x6b
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1558 let seq = printf("\<Esc>]11;rgb:%02x00/%02x00/%02x00\x07", red, green, blue)
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1559 call feedkeys(seq, 'Lx!')
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1560 call assert_equal(seq, v:termrbgresp)
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1561 call assert_equal('dark', &background)
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1562
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1563 " response to t_RB, 4 digits, light
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1564 set background=dark
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1565 call test_option_not_set('background')
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1566 let red = 0x81
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1567 let green = 0x63
16936
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1568 let blue = 0x65
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1569 let seq = printf("\<Esc>]11;rgb:%02x00/%02x00/%02x00\x07", red, green, blue)
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1570 call feedkeys(seq, 'Lx!')
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1571 call assert_equal(seq, v:termrbgresp)
16940
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1572 call assert_equal('light', &background)
16936
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1573
16940
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1574 " response to t_RB, 2 digits, dark
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1575 set background=light
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1576 call test_option_not_set('background')
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1577 let red = 0x47
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1578 let green = 0x59
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1579 let blue = 0x5b
16936
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1580 let seq = printf("\<Esc>]11;rgb:%02x/%02x/%02x\x07", red, green, blue)
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1581 call feedkeys(seq, 'Lx!')
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1582 call assert_equal(seq, v:termrbgresp)
16940
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1583 call assert_equal('dark', &background)
18918
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1584
16940
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1585 " response to t_RB, 2 digits, light
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1586 set background=dark
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1587 call test_option_not_set('background')
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1588 let red = 0x83
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1589 let green = 0xa4
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1590 let blue = 0xc2
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1591 let seq = printf("\<Esc>]11;rgb:%02x/%02x/%02x\x07", red, green, blue)
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1592 call feedkeys(seq, 'Lx!')
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1593 call assert_equal(seq, v:termrbgresp)
1c264ca8f2e8 patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents: 16936
diff changeset
1594 call assert_equal('light', &background)
18918
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1595
16936
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1596 set t_RF= t_RB=
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1597 endfunc
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1598
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1599 " This only checks if the sequence is recognized.
18285
db8cd5e56586 patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents: 18247
diff changeset
1600 " This must be after other tests, because it has side effects to xterm
db8cd5e56586 patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents: 18247
diff changeset
1601 " properties.
db8cd5e56586 patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents: 18247
diff changeset
1602 func Test_xx01_term_style_response()
16936
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1603 " Termresponse is only parsed when t_RV is not empty.
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1604 set t_RV=x
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1605 call test_override('term_props', 1)
16936
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1606
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1607 " send the termresponse to trigger requesting the XT codes
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1608 let seq = "\<Esc>[>41;337;0c"
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1609 call feedkeys(seq, 'Lx!')
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1610 call assert_equal(seq, v:termresponse)
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1611
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1612 let seq = "\<Esc>P1$r2 q\<Esc>\\"
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1613 call feedkeys(seq, 'Lx!')
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1614 call assert_equal(seq, v:termstyleresp)
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1615
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1616 call assert_equal(#{
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1617 \ cursor_style: 'u',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1618 \ cursor_blink_mode: 'u',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1619 \ underline_rgb: 'u',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1620 \ mouse: 's'
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1621 \ }, terminalprops())
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1622
16936
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1623 set t_RV=
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1624 call test_override('term_props', 0)
16936
73e6ed2f69a2 patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents: 16493
diff changeset
1625 endfunc
16942
5f3e960ce76d patch 8.1.1472: add_termcap_entry() is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16940
diff changeset
1626
18360
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1627 " This checks the iTerm2 version response.
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1628 " This must be after other tests, because it has side effects to xterm
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1629 " properties.
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1630 func Test_xx02_iTerm2_response()
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1631 " Termresponse is only parsed when t_RV is not empty.
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1632 set t_RV=x
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1633 call test_override('term_props', 1)
18360
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1634
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1635 " Old versions of iTerm2 used a different style term response.
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1636 set ttymouse=xterm
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1637 call test_option_not_set('ttymouse')
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1638 let seq = "\<Esc>[>0;95;c"
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1639 call feedkeys(seq, 'Lx!')
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1640 call assert_equal(seq, v:termresponse)
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1641 call assert_equal('xterm', &ttymouse)
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1642
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1643 set ttymouse=xterm
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1644 call test_option_not_set('ttymouse')
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1645 let seq = "\<Esc>[>0;95;0c"
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1646 call feedkeys(seq, 'Lx!')
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1647 call assert_equal(seq, v:termresponse)
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1648 call assert_equal('sgr', &ttymouse)
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1649
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1650 call assert_equal(#{
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1651 \ cursor_style: 'n',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1652 \ cursor_blink_mode: 'u',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1653 \ underline_rgb: 'u',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1654 \ mouse: 's'
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1655 \ }, terminalprops())
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1656
18360
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1657 set t_RV=
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1658 call test_override('term_props', 0)
18360
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1659 endfunc
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1660
18285
db8cd5e56586 patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents: 18247
diff changeset
1661 " This checks the libvterm version response.
db8cd5e56586 patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents: 18247
diff changeset
1662 " This must be after other tests, because it has side effects to xterm
db8cd5e56586 patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents: 18247
diff changeset
1663 " properties.
18360
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1664 func Test_xx03_libvterm_response()
18285
db8cd5e56586 patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents: 18247
diff changeset
1665 " Termresponse is only parsed when t_RV is not empty.
db8cd5e56586 patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents: 18247
diff changeset
1666 set t_RV=x
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1667 call test_override('term_props', 1)
18311
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1668
18285
db8cd5e56586 patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents: 18247
diff changeset
1669 set ttymouse=xterm
db8cd5e56586 patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents: 18247
diff changeset
1670 call test_option_not_set('ttymouse')
db8cd5e56586 patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents: 18247
diff changeset
1671 let seq = "\<Esc>[>0;100;0c"
db8cd5e56586 patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents: 18247
diff changeset
1672 call feedkeys(seq, 'Lx!')
db8cd5e56586 patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents: 18247
diff changeset
1673 call assert_equal(seq, v:termresponse)
db8cd5e56586 patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents: 18247
diff changeset
1674 call assert_equal('sgr', &ttymouse)
db8cd5e56586 patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents: 18247
diff changeset
1675
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1676 call assert_equal(#{
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1677 \ cursor_style: 'n',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1678 \ cursor_blink_mode: 'u',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1679 \ underline_rgb: 'u',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1680 \ mouse: 's'
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1681 \ }, terminalprops())
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1682
18285
db8cd5e56586 patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents: 18247
diff changeset
1683 set t_RV=
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1684 call test_override('term_props', 0)
18285
db8cd5e56586 patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents: 18247
diff changeset
1685 endfunc
db8cd5e56586 patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents: 18247
diff changeset
1686
18360
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1687 " This checks the Mac Terminal.app version response.
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1688 " This must be after other tests, because it has side effects to xterm
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1689 " properties.
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1690 func Test_xx04_Mac_Terminal_response()
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1691 " Termresponse is only parsed when t_RV is not empty.
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1692 set t_RV=x
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1693 call test_override('term_props', 1)
18360
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1694
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1695 set ttymouse=xterm
20850
bf7453768034 patch 8.2.0977: t_8u is made empty for the wrong terminals
Bram Moolenaar <Bram@vim.org>
parents: 20836
diff changeset
1696 " t_8u is not reset
bf7453768034 patch 8.2.0977: t_8u is made empty for the wrong terminals
Bram Moolenaar <Bram@vim.org>
parents: 20836
diff changeset
1697 let &t_8u = "\<Esc>[58;2;%lu;%lu;%lum"
18360
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1698 call test_option_not_set('ttymouse')
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1699 let seq = "\<Esc>[>1;95;0c"
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1700 call feedkeys(seq, 'Lx!')
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1701 call assert_equal(seq, v:termresponse)
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1702 call assert_equal('sgr', &ttymouse)
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1703
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1704 call assert_equal(#{
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1705 \ cursor_style: 'n',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1706 \ cursor_blink_mode: 'u',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1707 \ underline_rgb: 'y',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1708 \ mouse: 's'
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1709 \ }, terminalprops())
20850
bf7453768034 patch 8.2.0977: t_8u is made empty for the wrong terminals
Bram Moolenaar <Bram@vim.org>
parents: 20836
diff changeset
1710 call assert_equal("\<Esc>[58;2;%lu;%lu;%lum", &t_8u)
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1711
18360
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1712 " Reset is_not_xterm and is_mac_terminal.
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1713 set t_RV=
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1714 set term=xterm
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1715 set t_RV=x
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1716 call test_override('term_props', 0)
18360
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1717 endfunc
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1718
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1719 " This checks the mintty version response.
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1720 " This must be after other tests, because it has side effects to xterm
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1721 " properties.
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1722 func Test_xx05_mintty_response()
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1723 " Termresponse is only parsed when t_RV is not empty.
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1724 set t_RV=x
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1725 call test_override('term_props', 1)
18360
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1726
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1727 set ttymouse=xterm
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1728 call test_option_not_set('ttymouse')
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1729 let seq = "\<Esc>[>77;20905;0c"
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1730 call feedkeys(seq, 'Lx!')
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1731 call assert_equal(seq, v:termresponse)
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1732 call assert_equal('sgr', &ttymouse)
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1733
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1734 call assert_equal(#{
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1735 \ cursor_style: 'n',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1736 \ cursor_blink_mode: 'u',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1737 \ underline_rgb: 'y',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1738 \ mouse: 's'
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1739 \ }, terminalprops())
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1740
18360
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1741 set t_RV=
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1742 call test_override('term_props', 0)
18360
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1743 endfunc
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1744
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1745 " This checks the screen version response.
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1746 " This must be after other tests, because it has side effects to xterm
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1747 " properties.
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1748 func Test_xx06_screen_response()
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1749 " Termresponse is only parsed when t_RV is not empty.
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1750 set t_RV=x
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1751 call test_override('term_props', 1)
18360
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1752
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1753 " Old versions of screen don't support SGR mouse mode.
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1754 set ttymouse=xterm
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1755 call test_option_not_set('ttymouse')
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1756 let seq = "\<Esc>[>83;40500;0c"
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1757 call feedkeys(seq, 'Lx!')
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1758 call assert_equal(seq, v:termresponse)
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1759 call assert_equal('xterm', &ttymouse)
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1760
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1761 " screen supports SGR mouse mode starting in version 4.7.
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1762 set ttymouse=xterm
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1763 call test_option_not_set('ttymouse')
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1764 let seq = "\<Esc>[>83;40700;0c"
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1765 call feedkeys(seq, 'Lx!')
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1766 call assert_equal(seq, v:termresponse)
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1767 call assert_equal('sgr', &ttymouse)
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1768
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1769 call assert_equal(#{
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1770 \ cursor_style: 'n',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1771 \ cursor_blink_mode: 'n',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1772 \ underline_rgb: 'y',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1773 \ mouse: 's'
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1774 \ }, terminalprops())
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1775
18360
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1776 set t_RV=
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1777 call test_override('term_props', 0)
18360
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1778 endfunc
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1779
18311
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1780 " This checks the xterm version response.
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1781 " This must be after other tests, because it has side effects to xterm
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1782 " properties.
18360
e460e6878406 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents: 18350
diff changeset
1783 func Test_xx07_xterm_response()
18311
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1784 " Termresponse is only parsed when t_RV is not empty.
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1785 set t_RV=x
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1786 call test_override('term_props', 1)
18311
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1787
18350
b1796f1b28fa patch 8.1.2169: terminal flags are never reset
Bram Moolenaar <Bram@vim.org>
parents: 18311
diff changeset
1788 " Do Terminal.app first to check that is_mac_terminal is reset.
b1796f1b28fa patch 8.1.2169: terminal flags are never reset
Bram Moolenaar <Bram@vim.org>
parents: 18311
diff changeset
1789 set ttymouse=xterm
b1796f1b28fa patch 8.1.2169: terminal flags are never reset
Bram Moolenaar <Bram@vim.org>
parents: 18311
diff changeset
1790 call test_option_not_set('ttymouse')
b1796f1b28fa patch 8.1.2169: terminal flags are never reset
Bram Moolenaar <Bram@vim.org>
parents: 18311
diff changeset
1791 let seq = "\<Esc>[>1;95;0c"
b1796f1b28fa patch 8.1.2169: terminal flags are never reset
Bram Moolenaar <Bram@vim.org>
parents: 18311
diff changeset
1792 call feedkeys(seq, 'Lx!')
b1796f1b28fa patch 8.1.2169: terminal flags are never reset
Bram Moolenaar <Bram@vim.org>
parents: 18311
diff changeset
1793 call assert_equal(seq, v:termresponse)
b1796f1b28fa patch 8.1.2169: terminal flags are never reset
Bram Moolenaar <Bram@vim.org>
parents: 18311
diff changeset
1794 call assert_equal('sgr', &ttymouse)
b1796f1b28fa patch 8.1.2169: terminal flags are never reset
Bram Moolenaar <Bram@vim.org>
parents: 18311
diff changeset
1795
18311
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1796 " xterm < 95: "xterm" (actually unmodified)
18350
b1796f1b28fa patch 8.1.2169: terminal flags are never reset
Bram Moolenaar <Bram@vim.org>
parents: 18311
diff changeset
1797 set t_RV=
b1796f1b28fa patch 8.1.2169: terminal flags are never reset
Bram Moolenaar <Bram@vim.org>
parents: 18311
diff changeset
1798 set term=xterm
b1796f1b28fa patch 8.1.2169: terminal flags are never reset
Bram Moolenaar <Bram@vim.org>
parents: 18311
diff changeset
1799 set t_RV=x
18311
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1800 set ttymouse=xterm
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1801 call test_option_not_set('ttymouse')
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1802 let seq = "\<Esc>[>0;94;0c"
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1803 call feedkeys(seq, 'Lx!')
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1804 call assert_equal(seq, v:termresponse)
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1805 call assert_equal('xterm', &ttymouse)
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1806
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1807 call assert_equal(#{
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1808 \ cursor_style: 'n',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1809 \ cursor_blink_mode: 'u',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1810 \ underline_rgb: 'y',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1811 \ mouse: 'u'
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1812 \ }, terminalprops())
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1813
18311
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1814 " xterm >= 95 < 277 "xterm2"
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1815 set ttymouse=xterm
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1816 call test_option_not_set('ttymouse')
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1817 let seq = "\<Esc>[>0;267;0c"
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1818 call feedkeys(seq, 'Lx!')
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1819 call assert_equal(seq, v:termresponse)
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1820 call assert_equal('xterm2', &ttymouse)
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1821
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1822 call assert_equal(#{
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1823 \ cursor_style: 'n',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1824 \ cursor_blink_mode: 'u',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1825 \ underline_rgb: 'u',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1826 \ mouse: '2'
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1827 \ }, terminalprops())
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1828
18311
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1829 " xterm >= 277: "sgr"
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1830 set ttymouse=xterm
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1831 call test_option_not_set('ttymouse')
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1832 let seq = "\<Esc>[>0;277;0c"
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1833 call feedkeys(seq, 'Lx!')
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1834 call assert_equal(seq, v:termresponse)
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1835 call assert_equal('sgr', &ttymouse)
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1836
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1837 call assert_equal(#{
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1838 \ cursor_style: 'n',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1839 \ cursor_blink_mode: 'u',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1840 \ underline_rgb: 'u',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1841 \ mouse: 's'
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1842 \ }, terminalprops())
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1843
20850
bf7453768034 patch 8.2.0977: t_8u is made empty for the wrong terminals
Bram Moolenaar <Bram@vim.org>
parents: 20836
diff changeset
1844 " xterm >= 279: "sgr" and cursor_style not reset; also check t_8u reset
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1845 set ttymouse=xterm
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1846 call test_option_not_set('ttymouse')
20850
bf7453768034 patch 8.2.0977: t_8u is made empty for the wrong terminals
Bram Moolenaar <Bram@vim.org>
parents: 20836
diff changeset
1847 let &t_8u = "\<Esc>[58;2;%lu;%lu;%lum"
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1848 let seq = "\<Esc>[>0;279;0c"
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1849 call feedkeys(seq, 'Lx!')
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1850 call assert_equal(seq, v:termresponse)
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1851 call assert_equal('sgr', &ttymouse)
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1852
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1853 call assert_equal(#{
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1854 \ cursor_style: 'u',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1855 \ cursor_blink_mode: 'u',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1856 \ underline_rgb: 'u',
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1857 \ mouse: 's'
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1858 \ }, terminalprops())
20850
bf7453768034 patch 8.2.0977: t_8u is made empty for the wrong terminals
Bram Moolenaar <Bram@vim.org>
parents: 20836
diff changeset
1859 call assert_equal('', &t_8u)
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1860
18311
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1861 set t_RV=
20836
2616c5a337e0 patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 20727
diff changeset
1862 call test_override('term_props', 0)
18311
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1863 endfunc
60fce48438e2 patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents: 18307
diff changeset
1864
16942
5f3e960ce76d patch 8.1.1472: add_termcap_entry() is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16940
diff changeset
1865 func Test_get_termcode()
18247
eda5b2cb1dc4 patch 8.1.2118: termcodes test fails when $TERM is "dumb"
Bram Moolenaar <Bram@vim.org>
parents: 18223
diff changeset
1866 try
eda5b2cb1dc4 patch 8.1.2118: termcodes test fails when $TERM is "dumb"
Bram Moolenaar <Bram@vim.org>
parents: 18223
diff changeset
1867 let k1 = &t_k1
eda5b2cb1dc4 patch 8.1.2118: termcodes test fails when $TERM is "dumb"
Bram Moolenaar <Bram@vim.org>
parents: 18223
diff changeset
1868 catch /E113/
eda5b2cb1dc4 patch 8.1.2118: termcodes test fails when $TERM is "dumb"
Bram Moolenaar <Bram@vim.org>
parents: 18223
diff changeset
1869 throw 'Skipped: Unable to query termcodes'
eda5b2cb1dc4 patch 8.1.2118: termcodes test fails when $TERM is "dumb"
Bram Moolenaar <Bram@vim.org>
parents: 18223
diff changeset
1870 endtry
16942
5f3e960ce76d patch 8.1.1472: add_termcap_entry() is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16940
diff changeset
1871 set t_k1=
5f3e960ce76d patch 8.1.1472: add_termcap_entry() is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16940
diff changeset
1872 set t_k1&
5f3e960ce76d patch 8.1.1472: add_termcap_entry() is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16940
diff changeset
1873 call assert_equal(k1, &t_k1)
16947
b2179cf1a0a5 patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16942
diff changeset
1874
b2179cf1a0a5 patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16942
diff changeset
1875 " use external termcap first
b2179cf1a0a5 patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16942
diff changeset
1876 set nottybuiltin
b2179cf1a0a5 patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16942
diff changeset
1877 set t_k1=
b2179cf1a0a5 patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16942
diff changeset
1878 set t_k1&
b2179cf1a0a5 patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16942
diff changeset
1879 " when using external termcap may get something else, but it must not be
b2179cf1a0a5 patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16942
diff changeset
1880 " empty, since we would fallback to the builtin one.
b2179cf1a0a5 patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16942
diff changeset
1881 call assert_notequal('', &t_k1)
b2179cf1a0a5 patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16942
diff changeset
1882
b2179cf1a0a5 patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16942
diff changeset
1883 if &term =~ 'xterm'
b2179cf1a0a5 patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16942
diff changeset
1884 " use internal termcap first
b2179cf1a0a5 patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16942
diff changeset
1885 let term_save = &term
b2179cf1a0a5 patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16942
diff changeset
1886 let &term = 'builtin_' .. &term
b2179cf1a0a5 patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16942
diff changeset
1887 set t_k1=
b2179cf1a0a5 patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16942
diff changeset
1888 set t_k1&
b2179cf1a0a5 patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16942
diff changeset
1889 call assert_equal(k1, &t_k1)
b2179cf1a0a5 patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16942
diff changeset
1890 let &term = term_save
b2179cf1a0a5 patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16942
diff changeset
1891 endif
b2179cf1a0a5 patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16942
diff changeset
1892
b2179cf1a0a5 patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16942
diff changeset
1893 set ttybuiltin
16942
5f3e960ce76d patch 8.1.1472: add_termcap_entry() is not tested
Bram Moolenaar <Bram@vim.org>
parents: 16940
diff changeset
1894 endfunc
18289
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1895
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1896 func GetEscCodeCSI27(key, modifier)
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1897 let key = printf("%d", char2nr(a:key))
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1898 let mod = printf("%d", a:modifier)
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1899 return "\<Esc>[27;" .. mod .. ';' .. key .. '~'
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1900 endfunc
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1901
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1902 func GetEscCodeCSIu(key, modifier)
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1903 let key = printf("%d", char2nr(a:key))
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1904 let mod = printf("%d", a:modifier)
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1905 return "\<Esc>[" .. key .. ';' .. mod .. 'u'
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1906 endfunc
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1907
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1908 " This checks the CSI sequences when in modifyOtherKeys mode.
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1909 " The mode doesn't need to be enabled, the codes are always detected.
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1910 func RunTest_modifyOtherKeys(func)
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1911 new
18301
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
1912 set timeoutlen=10
18289
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1913
18918
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
1914 " Shift-X is sent as 'X' with the shift modifier
18289
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1915 call feedkeys('a' .. a:func('X', 2) .. "\<Esc>", 'Lx!')
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1916 call assert_equal('X', getline(1))
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1917
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1918 " Ctrl-i is Tab
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1919 call setline(1, '')
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1920 call feedkeys('a' .. a:func('i', 5) .. "\<Esc>", 'Lx!')
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1921 call assert_equal("\t", getline(1))
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1922
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1923 " Ctrl-I is also Tab
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1924 call setline(1, '')
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1925 call feedkeys('a' .. a:func('I', 5) .. "\<Esc>", 'Lx!')
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1926 call assert_equal("\t", getline(1))
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1927
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1928 " Alt-x is ø
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1929 call setline(1, '')
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1930 call feedkeys('a' .. a:func('x', 3) .. "\<Esc>", 'Lx!')
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1931 call assert_equal("ø", getline(1))
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1932
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1933 " Meta-x is also ø
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1934 call setline(1, '')
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1935 call feedkeys('a' .. a:func('x', 9) .. "\<Esc>", 'Lx!')
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1936 call assert_equal("ø", getline(1))
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1937
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1938 " Alt-X is Ø
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1939 call setline(1, '')
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1940 call feedkeys('a' .. a:func('X', 3) .. "\<Esc>", 'Lx!')
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1941 call assert_equal("Ø", getline(1))
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1942
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1943 " Meta-X is ø
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1944 call setline(1, '')
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1945 call feedkeys('a' .. a:func('X', 9) .. "\<Esc>", 'Lx!')
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1946 call assert_equal("Ø", getline(1))
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1947
18683
5ed740336224 patch 8.1.2333: with modifyOtherKeys CTRL-^ doesn't work
Bram Moolenaar <Bram@vim.org>
parents: 18627
diff changeset
1948 " Ctrl-6 is Ctrl-^
5ed740336224 patch 8.1.2333: with modifyOtherKeys CTRL-^ doesn't work
Bram Moolenaar <Bram@vim.org>
parents: 18627
diff changeset
1949 split aaa
5ed740336224 patch 8.1.2333: with modifyOtherKeys CTRL-^ doesn't work
Bram Moolenaar <Bram@vim.org>
parents: 18627
diff changeset
1950 edit bbb
5ed740336224 patch 8.1.2333: with modifyOtherKeys CTRL-^ doesn't work
Bram Moolenaar <Bram@vim.org>
parents: 18627
diff changeset
1951 call feedkeys(a:func('6', 5), 'Lx!')
5ed740336224 patch 8.1.2333: with modifyOtherKeys CTRL-^ doesn't work
Bram Moolenaar <Bram@vim.org>
parents: 18627
diff changeset
1952 call assert_equal("aaa", bufname())
5ed740336224 patch 8.1.2333: with modifyOtherKeys CTRL-^ doesn't work
Bram Moolenaar <Bram@vim.org>
parents: 18627
diff changeset
1953 bwipe aaa
5ed740336224 patch 8.1.2333: with modifyOtherKeys CTRL-^ doesn't work
Bram Moolenaar <Bram@vim.org>
parents: 18627
diff changeset
1954 bwipe bbb
5ed740336224 patch 8.1.2333: with modifyOtherKeys CTRL-^ doesn't work
Bram Moolenaar <Bram@vim.org>
parents: 18627
diff changeset
1955
18289
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1956 bwipe!
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1957 set timeoutlen&
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1958 endfunc
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1959
18301
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
1960 func Test_modifyOtherKeys_basic()
18289
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1961 call RunTest_modifyOtherKeys(function('GetEscCodeCSI27'))
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1962 call RunTest_modifyOtherKeys(function('GetEscCodeCSIu'))
16dd8ebc2339 patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents: 18285
diff changeset
1963 endfunc
18295
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
1964
18709
ac08c7ad9d37 patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18683
diff changeset
1965 func Test_modifyOtherKeys_no_mapping()
ac08c7ad9d37 patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18683
diff changeset
1966 set timeoutlen=10
ac08c7ad9d37 patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18683
diff changeset
1967
ac08c7ad9d37 patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18683
diff changeset
1968 let @a = 'aaa'
ac08c7ad9d37 patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18683
diff changeset
1969 call feedkeys(":let x = '" .. GetEscCodeCSI27('R', 5) .. GetEscCodeCSI27('R', 5) .. "a'\<CR>", 'Lx!')
ac08c7ad9d37 patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18683
diff changeset
1970 call assert_equal("let x = 'aaa'", @:)
ac08c7ad9d37 patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18683
diff changeset
1971
ac08c7ad9d37 patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18683
diff changeset
1972 new
ac08c7ad9d37 patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18683
diff changeset
1973 call feedkeys("a" .. GetEscCodeCSI27('R', 5) .. GetEscCodeCSI27('R', 5) .. "a\<Esc>", 'Lx!')
ac08c7ad9d37 patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18683
diff changeset
1974 call assert_equal("aaa", getline(1))
ac08c7ad9d37 patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18683
diff changeset
1975 bwipe!
ac08c7ad9d37 patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18683
diff changeset
1976
ac08c7ad9d37 patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18683
diff changeset
1977 new
ac08c7ad9d37 patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18683
diff changeset
1978 call feedkeys("axx\<CR>yy" .. GetEscCodeCSI27('G', 5) .. GetEscCodeCSI27('K', 5) .. "a\<Esc>", 'Lx!')
ac08c7ad9d37 patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18683
diff changeset
1979 call assert_equal("axx", getline(1))
ac08c7ad9d37 patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18683
diff changeset
1980 call assert_equal("yy", getline(2))
ac08c7ad9d37 patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18683
diff changeset
1981 bwipe!
ac08c7ad9d37 patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18683
diff changeset
1982
ac08c7ad9d37 patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18683
diff changeset
1983 set timeoutlen&
ac08c7ad9d37 patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18683
diff changeset
1984 endfunc
ac08c7ad9d37 patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18683
diff changeset
1985
18295
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
1986 func RunTest_mapping_shift(key, func)
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
1987 call setline(1, '')
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
1988 if a:key == '|'
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
1989 exe 'inoremap \| xyz'
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
1990 else
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
1991 exe 'inoremap ' .. a:key .. ' xyz'
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
1992 endif
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
1993 call feedkeys('a' .. a:func(a:key, 2) .. "\<Esc>", 'Lx!')
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
1994 call assert_equal("xyz", getline(1))
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
1995 if a:key == '|'
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
1996 exe 'iunmap \|'
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
1997 else
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
1998 exe 'iunmap ' .. a:key
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
1999 endif
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
2000 endfunc
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
2001
20727
5ffe112b1afd patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
2002 func Test_modifyOtherKeys_mapped()
5ffe112b1afd patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
2003 set timeoutlen=10
5ffe112b1afd patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
2004 imap ' <C-W>
5ffe112b1afd patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
2005 imap <C-W><C-A> c-a
5ffe112b1afd patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
2006 call setline(1, '')
5ffe112b1afd patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
2007
5ffe112b1afd patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
2008 " single quote is turned into single byte CTRL-W
5ffe112b1afd patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
2009 " CTRL-A is added with a separate modifier, and needs to be simplified before
5ffe112b1afd patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
2010 " the mapping can match.
5ffe112b1afd patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
2011 call feedkeys("a'" .. GetEscCodeCSI27('A', 5) .. "\<Esc>", 'Lx!')
5ffe112b1afd patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
2012 call assert_equal('c-a', getline(1))
5ffe112b1afd patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
2013
5ffe112b1afd patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
2014 iunmap '
5ffe112b1afd patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
2015 iunmap <C-W><C-A>
5ffe112b1afd patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
2016 set timeoutlen&
5ffe112b1afd patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
2017 endfunc
5ffe112b1afd patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
2018
18295
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
2019 func RunTest_mapping_works_with_shift(func)
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
2020 new
18301
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2021 set timeoutlen=10
18295
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
2022
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
2023 call RunTest_mapping_shift('@', a:func)
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
2024 call RunTest_mapping_shift('A', a:func)
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
2025 call RunTest_mapping_shift('Z', a:func)
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
2026 call RunTest_mapping_shift('^', a:func)
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
2027 call RunTest_mapping_shift('_', a:func)
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
2028 call RunTest_mapping_shift('{', a:func)
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
2029 call RunTest_mapping_shift('|', a:func)
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
2030 call RunTest_mapping_shift('}', a:func)
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
2031 call RunTest_mapping_shift('~', a:func)
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
2032
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
2033 bwipe!
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
2034 set timeoutlen&
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
2035 endfunc
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
2036
18301
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2037 func Test_mapping_works_with_shift_plain()
18295
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
2038 call RunTest_mapping_works_with_shift(function('GetEscCodeCSI27'))
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
2039 call RunTest_mapping_works_with_shift(function('GetEscCodeCSIu'))
43e9523f6d84 patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18289
diff changeset
2040 endfunc
18301
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2041
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2042 func RunTest_mapping_mods(map, key, func, code)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2043 call setline(1, '')
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2044 exe 'inoremap ' .. a:map .. ' xyz'
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2045 call feedkeys('a' .. a:func(a:key, a:code) .. "\<Esc>", 'Lx!')
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2046 call assert_equal("xyz", getline(1))
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2047 exe 'iunmap ' .. a:map
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2048 endfunc
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2049
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2050 func RunTest_mapping_works_with_mods(func, mods, code)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2051 new
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2052 set timeoutlen=10
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2053
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2054 if a:mods !~ 'S'
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2055 " Shift by itself has no effect
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2056 call RunTest_mapping_mods('<' .. a:mods .. '-@>', '@', a:func, a:code)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2057 endif
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2058 call RunTest_mapping_mods('<' .. a:mods .. '-A>', 'A', a:func, a:code)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2059 call RunTest_mapping_mods('<' .. a:mods .. '-Z>', 'Z', a:func, a:code)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2060 if a:mods !~ 'S'
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2061 " with Shift code is always upper case
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2062 call RunTest_mapping_mods('<' .. a:mods .. '-a>', 'a', a:func, a:code)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2063 call RunTest_mapping_mods('<' .. a:mods .. '-z>', 'z', a:func, a:code)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2064 endif
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2065 if a:mods != 'A'
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2066 " with Alt code is not in upper case
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2067 call RunTest_mapping_mods('<' .. a:mods .. '-a>', 'A', a:func, a:code)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2068 call RunTest_mapping_mods('<' .. a:mods .. '-z>', 'Z', a:func, a:code)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2069 endif
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2070 call RunTest_mapping_mods('<' .. a:mods .. '-á>', 'á', a:func, a:code)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2071 if a:mods !~ 'S'
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2072 " Shift by itself has no effect
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2073 call RunTest_mapping_mods('<' .. a:mods .. '-^>', '^', a:func, a:code)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2074 call RunTest_mapping_mods('<' .. a:mods .. '-_>', '_', a:func, a:code)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2075 call RunTest_mapping_mods('<' .. a:mods .. '-{>', '{', a:func, a:code)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2076 call RunTest_mapping_mods('<' .. a:mods .. '-\|>', '|', a:func, a:code)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2077 call RunTest_mapping_mods('<' .. a:mods .. '-}>', '}', a:func, a:code)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2078 call RunTest_mapping_mods('<' .. a:mods .. '-~>', '~', a:func, a:code)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2079 endif
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2080
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2081 bwipe!
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2082 set timeoutlen&
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2083 endfunc
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2084
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2085 func Test_mapping_works_with_shift()
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2086 call RunTest_mapping_works_with_mods(function('GetEscCodeCSI27'), 'S', 2)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2087 call RunTest_mapping_works_with_mods(function('GetEscCodeCSIu'), 'S', 2)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2088 endfunc
18918
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
2089
18301
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2090 func Test_mapping_works_with_ctrl()
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2091 call RunTest_mapping_works_with_mods(function('GetEscCodeCSI27'), 'C', 5)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2092 call RunTest_mapping_works_with_mods(function('GetEscCodeCSIu'), 'C', 5)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2093 endfunc
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2094
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2095 func Test_mapping_works_with_shift_ctrl()
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2096 call RunTest_mapping_works_with_mods(function('GetEscCodeCSI27'), 'C-S', 6)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2097 call RunTest_mapping_works_with_mods(function('GetEscCodeCSIu'), 'C-S', 6)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2098 endfunc
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2099
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2100 " Below we also test the "u" code with Alt, This works, but libvterm would not
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2101 " send the Alt key like this but by prefixing an Esc.
18918
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
2102
18301
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2103 func Test_mapping_works_with_alt()
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2104 call RunTest_mapping_works_with_mods(function('GetEscCodeCSI27'), 'A', 3)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2105 call RunTest_mapping_works_with_mods(function('GetEscCodeCSIu'), 'A', 3)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2106 endfunc
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2107
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2108 func Test_mapping_works_with_shift_alt()
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2109 call RunTest_mapping_works_with_mods(function('GetEscCodeCSI27'), 'S-A', 4)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2110 call RunTest_mapping_works_with_mods(function('GetEscCodeCSIu'), 'S-A', 4)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2111 endfunc
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2112
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2113 func Test_mapping_works_with_ctrl_alt()
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2114 call RunTest_mapping_works_with_mods(function('GetEscCodeCSI27'), 'C-A', 7)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2115 call RunTest_mapping_works_with_mods(function('GetEscCodeCSIu'), 'C-A', 7)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2116 endfunc
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2117
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2118 func Test_mapping_works_with_shift_ctrl_alt()
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2119 call RunTest_mapping_works_with_mods(function('GetEscCodeCSI27'), 'C-S-A', 8)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2120 call RunTest_mapping_works_with_mods(function('GetEscCodeCSIu'), 'C-S-A', 8)
506bf60a30a0 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 18295
diff changeset
2121 endfunc
18717
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2122
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2123 func Test_insert_literal()
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2124 set timeoutlen=10
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2125 new
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2126 " CTRL-V CTRL-X inserts a ^X
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2127 call feedkeys('a' .. GetEscCodeCSIu('V', '5') .. GetEscCodeCSIu('X', '5') .. "\<Esc>", 'Lx!')
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2128 call assert_equal("\<C-X>", getline(1))
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2129
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2130 call setline(1, '')
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2131 call feedkeys('a' .. GetEscCodeCSI27('V', '5') .. GetEscCodeCSI27('X', '5') .. "\<Esc>", 'Lx!')
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2132 call assert_equal("\<C-X>", getline(1))
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2133
18918
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
2134 " CTRL-SHIFT-V CTRL-X inserts escape sequence
18717
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2135 call setline(1, '')
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2136 call feedkeys('a' .. GetEscCodeCSIu('V', '6') .. GetEscCodeCSIu('X', '5') .. "\<Esc>", 'Lx!')
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2137 call assert_equal("\<Esc>[88;5u", getline(1))
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2138
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2139 call setline(1, '')
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2140 call feedkeys('a' .. GetEscCodeCSI27('V', '6') .. GetEscCodeCSI27('X', '5') .. "\<Esc>", 'Lx!')
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2141 call assert_equal("\<Esc>[27;5;88~", getline(1))
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2142
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2143 bwipe!
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2144 set timeoutlen&
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2145 endfunc
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2146
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2147 func Test_cmdline_literal()
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2148 set timeoutlen=10
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2149
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2150 " CTRL-V CTRL-Y inserts a ^Y
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2151 call feedkeys(':' .. GetEscCodeCSIu('V', '5') .. GetEscCodeCSIu('Y', '5') .. "\<C-B>\"\<CR>", 'Lx!')
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2152 call assert_equal("\"\<C-Y>", @:)
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2153
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2154 call feedkeys(':' .. GetEscCodeCSI27('V', '5') .. GetEscCodeCSI27('Y', '5') .. "\<C-B>\"\<CR>", 'Lx!')
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2155 call assert_equal("\"\<C-Y>", @:)
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2156
18918
5c256866b837 patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents: 18717
diff changeset
2157 " CTRL-SHIFT-V CTRL-Y inserts escape sequence
18717
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2158 call feedkeys(':' .. GetEscCodeCSIu('V', '6') .. GetEscCodeCSIu('Y', '5') .. "\<C-B>\"\<CR>", 'Lx!')
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2159 call assert_equal("\"\<Esc>[89;5u", @:)
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2160
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2161 call setline(1, '')
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2162 call feedkeys(':' .. GetEscCodeCSI27('V', '6') .. GetEscCodeCSI27('Y', '5') .. "\<C-B>\"\<CR>", 'Lx!')
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2163 call assert_equal("\"\<Esc>[27;5;89~", @:)
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2164
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2165 set timeoutlen&
14d2a210fab1 patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents: 18709
diff changeset
2166 endfunc
19657
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
2167
20313
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2168 " Test for translation of special key codes (<xF1>, <xF2>, etc.)
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2169 func Test_Keycode_Tranlsation()
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2170 let keycodes = [
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2171 \ ["<xUp>", "<Up>"],
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2172 \ ["<xDown>", "<Down>"],
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2173 \ ["<xLeft>", "<Left>"],
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2174 \ ["<xRight>", "<Right>"],
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2175 \ ["<xHome>", "<Home>"],
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2176 \ ["<xEnd>", "<End>"],
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2177 \ ["<zHome>", "<Home>"],
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2178 \ ["<zEnd>", "<End>"],
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2179 \ ["<xF1>", "<F1>"],
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2180 \ ["<xF2>", "<F2>"],
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2181 \ ["<xF3>", "<F3>"],
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2182 \ ["<xF4>", "<F4>"],
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2183 \ ["<S-xF1>", "<S-F1>"],
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2184 \ ["<S-xF2>", "<S-F2>"],
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2185 \ ["<S-xF3>", "<S-F3>"],
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2186 \ ["<S-xF4>", "<S-F4>"]]
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2187 for [k1, k2] in keycodes
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2188 exe "nnoremap " .. k1 .. " 2wx"
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2189 call assert_true(maparg(k1, 'n', 0, 1).lhs == k2)
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2190 exe "nunmap " .. k1
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2191 endfor
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2192 endfunc
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
2193
19657
da791e5c0139 patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18918
diff changeset
2194 " vim: shiftwidth=2 sts=2 expandtab